summaryrefslogtreecommitdiff
path: root/addons/product
diff options
context:
space:
mode:
authorAchraf (abz) <abz@odoo.com>2020-11-16 09:43:41 +0000
committerAchraf (abz) <abz@odoo.com>2020-11-17 11:34:07 +0000
commit958b8c5b475b037b3bf8d8bc8b87bf9501ccb779 (patch)
tree6baf8057c97a73d18d3c5677bde7442ecce33f01 /addons/product
parent304ebe3d930ca8deab71c6b8109cb73166fe7648 (diff)
[FIX] product: Change public pricelist currency when changing main currency
What are the steps to reproduce your issue ? 1. Go to 'odoo.com/trial' and create a database with 'account' or 1. Start local server with a new database and with '--without-demo=all --init=account' 2. Change main currency from 'EUR' to 'USD' in settings What is currently happening? Error raised when trying to install 'point_of_sale' What are you expecting to happen? Install 'point_of_sale' normally even after changing main currency Why is this happening? But there is a condition which verifies that there is not already a pricelist with the currency we want to set or with the currency of the company. Otherwise it prevents the pricelist modification How to fix the bug ? Change the condition so that it allows the change of the pricelist in the case where the currency we want to set is not the same as the currency of the company opw-2376457 closes odoo/odoo#61843 X-original-commit: 716e0e791da1e4647dab29959b7012e366aa7b1f Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/product')
-rw-r--r--addons/product/models/res_company.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/product/models/res_company.py b/addons/product/models/res_company.py
index 06004a38a0b..30ae4e95931 100644
--- a/addons/product/models/res_company.py
+++ b/addons/product/models/res_company.py
@@ -39,7 +39,7 @@ class ResCompany(models.Model):
existing_pricelist = ProductPricelist.search(
[('company_id', 'in', (False, company.id)),
('currency_id', 'in', (currency_id, company.currency_id.id))])
- if existing_pricelist:
+ if existing_pricelist and any(currency_id == x.currency_id.id for x in existing_pricelist):
continue
if currency_id == company.currency_id.id:
continue