Skip to content

Commit bb99f6b

Browse files
[MIG] product_pricelist_fixed_currency_rate: Migration to 18.0
1 parent 9efd078 commit bb99f6b

File tree

6 files changed

+101
-84
lines changed

6 files changed

+101
-84
lines changed

product_pricelist_fixed_currency_rate/README.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Product Pricelist Fixed Currency Rate
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
20-
:target: https://github.com/OCA/product-attribute/tree/17.0/product_pricelist_fixed_currency_rate
20+
:target: https://github.com/OCA/product-attribute/tree/18.0/product_pricelist_fixed_currency_rate
2121
:alt: OCA/product-attribute
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_pricelist_fixed_currency_rate
23+
:target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_pricelist_fixed_currency_rate
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -56,7 +56,7 @@ Bug Tracker
5656
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
5757
In case of trouble, please check there if your issue has already been reported.
5858
If you spotted it first, help us to smash it by providing a detailed and welcomed
59-
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_fixed_currency_rate%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
59+
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_fixed_currency_rate%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6060

6161
Do not contact contributors directly about support or help with technical issues.
6262

@@ -71,8 +71,9 @@ Authors
7171
Contributors
7272
------------
7373

74-
- Lois Rilo <[email protected]>
75-
- Mohamed Alkobrosli <[email protected]>
74+
- Lois Rilo <[email protected]>
75+
- Mohamed Alkobrosli <[email protected]>
76+
- Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>
7677

7778
Maintainers
7879
-----------
@@ -98,6 +99,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
9899

99100
|maintainer-LoisRForgeFlow| |maintainer-kobros-tech|
100101

101-
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/17.0/product_pricelist_fixed_currency_rate>`_ project on GitHub.
102+
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/18.0/product_pricelist_fixed_currency_rate>`_ project on GitHub.
102103

103104
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

product_pricelist_fixed_currency_rate/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Product Pricelist Fixed Currency Rate",
66
"summary": "Set a fixed currency rate between pricelists",
7-
"version": "17.0.1.0.0",
7+
"version": "18.0.1.0.0",
88
"category": "Product",
99
"website": "https://github.com/OCA/product-attribute",
1010
"author": "ForgeFlow, Odoo Community Association (OCA)",
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
- Lois Rilo \<<[email protected]>\>
22
- Mohamed Alkobrosli \<<[email protected]>\>
3+
- Heliconia Solutions Pvt. Ltd. \<<https://www.heliconia.io>\>

product_pricelist_fixed_currency_rate/static/description/index.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Product Pricelist Fixed Currency Rate</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:db69ced5276e16601e3f8a0dad96a12d837f7d194b980fa9fcc44a77ddf508d4
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/17.0/product_pricelist_fixed_currency_rate"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_pricelist_fixed_currency_rate"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/18.0/product_pricelist_fixed_currency_rate"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_pricelist_fixed_currency_rate"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module extends the product pricelists feature to allow to set a
374374
fixed currency rate to convert from a pricelist with a different
375375
currency.</p>
@@ -403,7 +403,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
403403
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/issues">GitHub Issues</a>.
404404
In case of trouble, please check there if your issue has already been reported.
405405
If you spotted it first, help us to smash it by providing a detailed and welcomed
406-
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_fixed_currency_rate%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
406+
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_fixed_currency_rate%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
407407
<p>Do not contact contributors directly about support or help with technical issues.</p>
408408
</div>
409409
<div class="section" id="credits">
@@ -419,6 +419,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
419419
<ul class="simple">
420420
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
421421
<li>Mohamed Alkobrosli &lt;<a class="reference external" href="mailto:mohamed&#64;kobros-tech.com">mohamed&#64;kobros-tech.com</a>&gt;</li>
422+
<li>Heliconia Solutions Pvt. Ltd. &lt;<a class="reference external" href="https://www.heliconia.io">https://www.heliconia.io</a>&gt;</li>
422423
</ul>
423424
</div>
424425
<div class="section" id="maintainers">
@@ -432,7 +433,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
432433
promote its widespread use.</p>
433434
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
434435
<p><a class="reference external image-reference" href="https://github.com/LoisRForgeFlow"><img alt="LoisRForgeFlow" src="https://github.com/LoisRForgeFlow.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/kobros-tech"><img alt="kobros-tech" src="https://github.com/kobros-tech.png?size=40px" /></a></p>
435-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/17.0/product_pricelist_fixed_currency_rate">OCA/product-attribute</a> project on GitHub.</p>
436+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/18.0/product_pricelist_fixed_currency_rate">OCA/product-attribute</a> project on GitHub.</p>
436437
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
437438
</div>
438439
</div>

product_pricelist_fixed_currency_rate/tests/test_product_pricelist_fixed_currency_rate.py

+86-72
Original file line numberDiff line numberDiff line change
@@ -12,85 +12,97 @@ def setUpClass(cls):
1212
cls.product_model = cls.env["product.product"]
1313

1414
cls.company = cls.env["res.company"].create(
15-
{
16-
"name": "Test",
17-
"currency_id": cls.env.ref("base.EUR").id,
18-
}
15+
[
16+
{
17+
"name": "Test",
18+
"currency_id": cls.env.ref("base.EUR").id,
19+
}
20+
]
1921
)
2022
cls.env.user.company_id = cls.company
2123

2224
cls.product_1 = cls.product_model.create(
23-
{
24-
"name": "Product 1",
25-
"list_price": 150.00,
26-
"company_id": cls.company.id,
27-
}
25+
[
26+
{
27+
"name": "Product 1",
28+
"list_price": 150.00,
29+
"company_id": cls.company.id,
30+
}
31+
]
2832
)
2933
cls.product_2 = cls.product_model.create(
30-
{
31-
"name": "Product 1",
32-
"list_price": 200.00,
33-
"company_id": cls.company.id,
34-
}
34+
[
35+
{
36+
"name": "Product 1",
37+
"list_price": 200.00,
38+
"company_id": cls.company.id,
39+
}
40+
]
3541
)
3642

3743
cls.pricelist_eur = cls.pricelist_model.create(
38-
{
39-
"name": "Pricelist EUR",
40-
"currency_id": cls.env.ref("base.EUR").id,
41-
"company_id": cls.company.id,
42-
"item_ids": [
43-
(
44-
0,
45-
0,
46-
{
47-
"applied_on": "0_product_variant",
48-
"compute_price": "fixed",
49-
"product_id": cls.product_1.id,
50-
"fixed_price": 140.00,
51-
},
52-
)
53-
],
54-
}
44+
[
45+
{
46+
"name": "Pricelist EUR",
47+
"currency_id": cls.env.ref("base.EUR").id,
48+
"company_id": cls.company.id,
49+
"item_ids": [
50+
(
51+
0,
52+
0,
53+
{
54+
"applied_on": "0_product_variant",
55+
"compute_price": "fixed",
56+
"product_id": cls.product_1.id,
57+
"fixed_price": 140.00,
58+
},
59+
)
60+
],
61+
}
62+
]
5563
)
5664
cls.pricelist_usd = cls.pricelist_model.create(
57-
{
58-
"name": "Pricelist USD",
59-
"currency_id": cls.env.ref("base.USD").id,
60-
"company_id": cls.company.id,
61-
"item_ids": [
62-
(
63-
0,
64-
0,
65-
{
66-
"applied_on": "3_global",
67-
"compute_price": "formula",
68-
"base": "pricelist",
69-
"base_pricelist_id": cls.pricelist_eur.id,
70-
},
71-
)
72-
],
73-
}
65+
[
66+
{
67+
"name": "Pricelist USD",
68+
"currency_id": cls.env.ref("base.USD").id,
69+
"company_id": cls.company.id,
70+
"item_ids": [
71+
(
72+
0,
73+
0,
74+
{
75+
"applied_on": "3_global",
76+
"compute_price": "formula",
77+
"base": "pricelist",
78+
"base_pricelist_id": cls.pricelist_eur.id,
79+
},
80+
)
81+
],
82+
}
83+
]
7484
)
7585
cls.pricelist_usd_fixed_rate = cls.pricelist_model.create(
76-
{
77-
"name": "Pricelist USD",
78-
"currency_id": cls.env.ref("base.USD").id,
79-
"company_id": cls.company.id,
80-
"item_ids": [
81-
(
82-
0,
83-
0,
84-
{
85-
"applied_on": "3_global",
86-
"compute_price": "formula",
87-
"base": "pricelist",
88-
"base_pricelist_id": cls.pricelist_eur.id,
89-
"fixed_currency_rate": 2.0,
90-
},
91-
)
92-
],
93-
}
86+
[
87+
{
88+
"name": "Pricelist USD",
89+
"currency_id": cls.env.ref("base.USD").id,
90+
"company_id": cls.company.id,
91+
"item_ids": [
92+
(
93+
0,
94+
0,
95+
{
96+
"applied_on": "3_global",
97+
"compute_price": "formula",
98+
"base": "pricelist",
99+
"base_pricelist_id": cls.pricelist_eur.id,
100+
"fixed_currency_rate": 2.0,
101+
},
102+
)
103+
],
104+
}
105+
]
94106
)
95107
# Clean rates:
96108
cls.env["res.currency.rate"].search(
@@ -100,12 +112,14 @@ def setUpClass(cls):
100112
]
101113
).unlink()
102114
cls.env["res.currency.rate"].create(
103-
{
104-
"name": "2023-01-01",
105-
"rate": 1.5,
106-
"currency_id": cls.env.ref("base.USD").id,
107-
"company_id": cls.company.id,
108-
}
115+
[
116+
{
117+
"name": "2023-01-01",
118+
"rate": 1.5,
119+
"currency_id": cls.env.ref("base.USD").id,
120+
"company_id": cls.company.id,
121+
}
122+
]
109123
)
110124

111125
def test_01_pricelist_currency_rate(self):

product_pricelist_fixed_currency_rate/views/pricelist_views.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<field name="model">product.pricelist.item</field>
88
<field name="inherit_id" ref="product.product_pricelist_item_form_view" />
99
<field name="arch" type="xml">
10-
<field name="base_pricelist_id" position="after">
10+
<field name="min_quantity" position="after">
1111
<field name="is_fixed_currency_rate_applicable" invisible="1" />
1212
<field name="do_inverse_currency_rate" invisible="1" />
1313
<field

0 commit comments

Comments
 (0)