From bb99f6b74f50e6e4ac765868cb2510d855280d5c Mon Sep 17 00:00:00 2001
From: Heliconia Solutions
Date: Mon, 2 Dec 2024 11:17:29 +0530
Subject: [PATCH] [MIG] product_pricelist_fixed_currency_rate: Migration to
18.0
---
.../README.rst | 15 +-
.../__manifest__.py | 2 +-
.../readme/CONTRIBUTORS.md | 1 +
.../static/description/index.html | 7 +-
...t_product_pricelist_fixed_currency_rate.py | 158 ++++++++++--------
.../views/pricelist_views.xml | 2 +-
6 files changed, 101 insertions(+), 84 deletions(-)
diff --git a/product_pricelist_fixed_currency_rate/README.rst b/product_pricelist_fixed_currency_rate/README.rst
index 915fa01415b..16686474e5f 100644
--- a/product_pricelist_fixed_currency_rate/README.rst
+++ b/product_pricelist_fixed_currency_rate/README.rst
@@ -17,13 +17,13 @@ Product Pricelist Fixed Currency Rate
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
- :target: https://github.com/OCA/product-attribute/tree/17.0/product_pricelist_fixed_currency_rate
+ :target: https://github.com/OCA/product-attribute/tree/18.0/product_pricelist_fixed_currency_rate
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_pricelist_fixed_currency_rate
+ :target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_pricelist_fixed_currency_rate
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -71,8 +71,9 @@ Authors
Contributors
------------
-- Lois Rilo
-- Mohamed Alkobrosli
+- Lois Rilo
+- Mohamed Alkobrosli
+- Heliconia Solutions Pvt. Ltd.
Maintainers
-----------
@@ -98,6 +99,6 @@ Current `maintainers `__:
|maintainer-LoisRForgeFlow| |maintainer-kobros-tech|
-This module is part of the `OCA/product-attribute `_ project on GitHub.
+This module is part of the `OCA/product-attribute `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/product_pricelist_fixed_currency_rate/__manifest__.py b/product_pricelist_fixed_currency_rate/__manifest__.py
index 84d4e04e5b3..822014290a5 100644
--- a/product_pricelist_fixed_currency_rate/__manifest__.py
+++ b/product_pricelist_fixed_currency_rate/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Product Pricelist Fixed Currency Rate",
"summary": "Set a fixed currency rate between pricelists",
- "version": "17.0.1.0.0",
+ "version": "18.0.1.0.0",
"category": "Product",
"website": "https://github.com/OCA/product-attribute",
"author": "ForgeFlow, Odoo Community Association (OCA)",
diff --git a/product_pricelist_fixed_currency_rate/readme/CONTRIBUTORS.md b/product_pricelist_fixed_currency_rate/readme/CONTRIBUTORS.md
index c90fd656ca2..98ff7eb6c0e 100644
--- a/product_pricelist_fixed_currency_rate/readme/CONTRIBUTORS.md
+++ b/product_pricelist_fixed_currency_rate/readme/CONTRIBUTORS.md
@@ -1,2 +1,3 @@
- Lois Rilo \<\>
- Mohamed Alkobrosli \<\>
+- Heliconia Solutions Pvt. Ltd. \<\>
diff --git a/product_pricelist_fixed_currency_rate/static/description/index.html b/product_pricelist_fixed_currency_rate/static/description/index.html
index 4488701f7c0..3f2329c8fe5 100644
--- a/product_pricelist_fixed_currency_rate/static/description/index.html
+++ b/product_pricelist_fixed_currency_rate/static/description/index.html
@@ -369,7 +369,7 @@ Product Pricelist Fixed Currency Rate
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:db69ced5276e16601e3f8a0dad96a12d837f7d194b980fa9fcc44a77ddf508d4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module extends the product pricelists feature to allow to set a
fixed currency rate to convert from a pricelist with a different
currency.
@@ -403,7 +403,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -432,7 +433,7 @@
promote its widespread use.
Current maintainers:
-
This module is part of the OCA/product-attribute project on GitHub.
+
This module is part of the OCA/product-attribute project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/product_pricelist_fixed_currency_rate/tests/test_product_pricelist_fixed_currency_rate.py b/product_pricelist_fixed_currency_rate/tests/test_product_pricelist_fixed_currency_rate.py
index b5ce81d18a3..b7a19508fe1 100644
--- a/product_pricelist_fixed_currency_rate/tests/test_product_pricelist_fixed_currency_rate.py
+++ b/product_pricelist_fixed_currency_rate/tests/test_product_pricelist_fixed_currency_rate.py
@@ -12,85 +12,97 @@ def setUpClass(cls):
cls.product_model = cls.env["product.product"]
cls.company = cls.env["res.company"].create(
- {
- "name": "Test",
- "currency_id": cls.env.ref("base.EUR").id,
- }
+ [
+ {
+ "name": "Test",
+ "currency_id": cls.env.ref("base.EUR").id,
+ }
+ ]
)
cls.env.user.company_id = cls.company
cls.product_1 = cls.product_model.create(
- {
- "name": "Product 1",
- "list_price": 150.00,
- "company_id": cls.company.id,
- }
+ [
+ {
+ "name": "Product 1",
+ "list_price": 150.00,
+ "company_id": cls.company.id,
+ }
+ ]
)
cls.product_2 = cls.product_model.create(
- {
- "name": "Product 1",
- "list_price": 200.00,
- "company_id": cls.company.id,
- }
+ [
+ {
+ "name": "Product 1",
+ "list_price": 200.00,
+ "company_id": cls.company.id,
+ }
+ ]
)
cls.pricelist_eur = cls.pricelist_model.create(
- {
- "name": "Pricelist EUR",
- "currency_id": cls.env.ref("base.EUR").id,
- "company_id": cls.company.id,
- "item_ids": [
- (
- 0,
- 0,
- {
- "applied_on": "0_product_variant",
- "compute_price": "fixed",
- "product_id": cls.product_1.id,
- "fixed_price": 140.00,
- },
- )
- ],
- }
+ [
+ {
+ "name": "Pricelist EUR",
+ "currency_id": cls.env.ref("base.EUR").id,
+ "company_id": cls.company.id,
+ "item_ids": [
+ (
+ 0,
+ 0,
+ {
+ "applied_on": "0_product_variant",
+ "compute_price": "fixed",
+ "product_id": cls.product_1.id,
+ "fixed_price": 140.00,
+ },
+ )
+ ],
+ }
+ ]
)
cls.pricelist_usd = cls.pricelist_model.create(
- {
- "name": "Pricelist USD",
- "currency_id": cls.env.ref("base.USD").id,
- "company_id": cls.company.id,
- "item_ids": [
- (
- 0,
- 0,
- {
- "applied_on": "3_global",
- "compute_price": "formula",
- "base": "pricelist",
- "base_pricelist_id": cls.pricelist_eur.id,
- },
- )
- ],
- }
+ [
+ {
+ "name": "Pricelist USD",
+ "currency_id": cls.env.ref("base.USD").id,
+ "company_id": cls.company.id,
+ "item_ids": [
+ (
+ 0,
+ 0,
+ {
+ "applied_on": "3_global",
+ "compute_price": "formula",
+ "base": "pricelist",
+ "base_pricelist_id": cls.pricelist_eur.id,
+ },
+ )
+ ],
+ }
+ ]
)
cls.pricelist_usd_fixed_rate = cls.pricelist_model.create(
- {
- "name": "Pricelist USD",
- "currency_id": cls.env.ref("base.USD").id,
- "company_id": cls.company.id,
- "item_ids": [
- (
- 0,
- 0,
- {
- "applied_on": "3_global",
- "compute_price": "formula",
- "base": "pricelist",
- "base_pricelist_id": cls.pricelist_eur.id,
- "fixed_currency_rate": 2.0,
- },
- )
- ],
- }
+ [
+ {
+ "name": "Pricelist USD",
+ "currency_id": cls.env.ref("base.USD").id,
+ "company_id": cls.company.id,
+ "item_ids": [
+ (
+ 0,
+ 0,
+ {
+ "applied_on": "3_global",
+ "compute_price": "formula",
+ "base": "pricelist",
+ "base_pricelist_id": cls.pricelist_eur.id,
+ "fixed_currency_rate": 2.0,
+ },
+ )
+ ],
+ }
+ ]
)
# Clean rates:
cls.env["res.currency.rate"].search(
@@ -100,12 +112,14 @@ def setUpClass(cls):
]
).unlink()
cls.env["res.currency.rate"].create(
- {
- "name": "2023-01-01",
- "rate": 1.5,
- "currency_id": cls.env.ref("base.USD").id,
- "company_id": cls.company.id,
- }
+ [
+ {
+ "name": "2023-01-01",
+ "rate": 1.5,
+ "currency_id": cls.env.ref("base.USD").id,
+ "company_id": cls.company.id,
+ }
+ ]
)
def test_01_pricelist_currency_rate(self):
diff --git a/product_pricelist_fixed_currency_rate/views/pricelist_views.xml b/product_pricelist_fixed_currency_rate/views/pricelist_views.xml
index 835a78a15d3..b356ded058e 100644
--- a/product_pricelist_fixed_currency_rate/views/pricelist_views.xml
+++ b/product_pricelist_fixed_currency_rate/views/pricelist_views.xml
@@ -7,7 +7,7 @@
product.pricelist.item
-
+