[FIX] product: filter out archived pricelists from candidate pricelists
Have a pricelist Pl set as property_product_pricelist on some partner Pa. Archive Pl, so that the public user Pu use another pricelist Pl'. Go to the shop, create some order. The prices are obtained from Pl'. Log in as Pa; prices are updated using Pl. However since Pl is archived, it is not visible on the pricelist views, so the end user cannot explain why the prices changed. When the pricelist is archived, nothing is done regarding the ir.property storing the partner/pricelist mapping, so the pricelist is retrieved as default nonetheless. We filter out the active pricelists when getting the property. opw 1946476 co-authored with JKE-be closes odoo/odoo#36389 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is contained in:
@@ -316,10 +316,10 @@ class Pricelist(models.Model):
|
||||
return res[partner_id].id
|
||||
|
||||
def _get_partner_pricelist_multi_search_domain_hook(self):
|
||||
return []
|
||||
return [('active', '=', True)]
|
||||
|
||||
def _get_partner_pricelist_multi_filter_hook(self):
|
||||
return self
|
||||
return self.filtered('active')
|
||||
|
||||
def _get_partner_pricelist_multi(self, partner_ids, company_id=None):
|
||||
""" Retrieve the applicable pricelist for given partners in a given company.
|
||||
|
||||
Reference in New Issue
Block a user