Files
odoo_source/addons/sale_stock_margin
mathysPaulandVictor Feyens 865b6703a1 [FIX] product,sale(_*): pricelists multi-company checks
Since 83c52575d0, there
is no default pricelist in new database, and a magic
pricelist is created for each company when the pricelist
setting is enabled.

But, since this automatically created pricelist is restricted
to a specific company, you couldn't use it as 'Base' for
rules of other pricelists, which are, by default, shared
between companies, unless you set a specific company on them.

This commit changes that default behavior, to restrict
pricelists to the current company (unless the field is
manually emptied), to avoid those multi-company issues,
particularly in single-company databases where
multi-company issues are not expected.

Also, while testing this task, we discovered that a user
could change the company of a pricelist, even if it conflicted
with existing rules.  To avoid this situation, we now trigger
the multi-company check on the pricelist rules when the
pricelist company is updated.

task-3610823

closes odoo/odoo#147014

Related: odoo/enterprise#55857
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2024-02-27 17:40:50 +00:00
..
…