From c2c35f32cc5a71b281137d016f863ccbac2848f8 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 25 Jul 2023 13:09:20 +0000 Subject: [PATCH] [FIX] product: default pricelist should take precedence over new ones The default pricelist automatically created for companies if the pricelists are enabled should (like it was before with the Public Pricelist record in the data) take precedence over newly created pricelists record. This can be enforced by creating the default pricelist with a higher priority (lower sequence). closes odoo/odoo#130232 X-original-commit: ea1e83514bd6190a516f2cf92f800625876b789e Signed-off-by: Victor Feyens (vfe) --- addons/product/models/res_company.py | 1 + .../tests/test_website_sale_product_attribute_value_config.py | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/product/models/res_company.py b/addons/product/models/res_company.py index 6831fb17b10..8061d3c2ff5 100644 --- a/addons/product/models/res_company.py +++ b/addons/product/models/res_company.py @@ -46,6 +46,7 @@ class ResCompany(models.Model): 'name': _("Default %s pricelist", self.currency_id.name), 'currency_id': self.currency_id.id, 'company_id': self.id, + 'sequence': 10, }) return values diff --git a/addons/website_sale/tests/test_website_sale_product_attribute_value_config.py b/addons/website_sale/tests/test_website_sale_product_attribute_value_config.py index 0b8e6e723aa..a9197ea99c3 100644 --- a/addons/website_sale/tests/test_website_sale_product_attribute_value_config.py +++ b/addons/website_sale/tests/test_website_sale_product_attribute_value_config.py @@ -167,6 +167,7 @@ class TestWebsiteSaleProductPricelist(AccountTestInvoicingCommon, TestSaleProduc # We will test that the mapping of an 10% included tax by a 6% by a fiscal position is taken into account when updating the cart self.env.user.partner_id.country_id = False current_website = self.env['website'].get_current_website() + self.env['product.pricelist'].search([]).action_archive() pricelist = self.env['product.pricelist'].create({ 'name': 'Base Pricelist', 'sequence': 4,