From 95324638c7ccff46bc8215dcd089fb14e66c2695 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Thu, 26 Mar 2020 08:56:17 +0000 Subject: [PATCH] [FIX] product: on CoA choose do not create pricelist if already present Create a new company with it's currency A default price list has been created for this company in this currency Install the "customizable Chart of Account" under the settings tab, Accounting By installing this CoA, Odoo creates a new pricelist, in Dollars, that overwrites the one in the currency of the country. Avoid creating the new pricelist if there is already a pricelist for the current company in the company currency opw-2221854 closes odoo/odoo#52429 X-original-commit: dc0d6af54f56bf6e576013d67cf44b5cd3608351 Signed-off-by: Nicolas Martinelli (nim) --- addons/product/models/res_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/res_company.py b/addons/product/models/res_company.py index 5a44de1afc1..06004a38a0b 100644 --- a/addons/product/models/res_company.py +++ b/addons/product/models/res_company.py @@ -38,7 +38,7 @@ class ResCompany(models.Model): for company in self: existing_pricelist = ProductPricelist.search( [('company_id', 'in', (False, company.id)), - ('currency_id', '=', currency_id)]) + ('currency_id', 'in', (currency_id, company.currency_id.id))]) if existing_pricelist: continue if currency_id == company.currency_id.id: