[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) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2023-08-01 22:31:01 +02:00
parent 13bfb9eecd
commit c2c35f32cc
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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
@@ -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,