[FIX] product: Impossible to get the right pricelist in multi company
The logic was not the same in function _compute_product_pricelist and in function _inverse_product_pricelist. The function _get_partner_pricelist must check the default pricelist for the company when no pricelist is given for the specific partner(res_id) because the function set_multi doesn't set a specific pricelist to the partner if the pricelist set and the default one are the same. opw:779808
This commit is contained in:
@@ -299,7 +299,7 @@ class Pricelist(models.Model):
|
||||
Property = self.env['ir.property'].with_context(force_company=company_id or self.env.user.company_id.id)
|
||||
|
||||
p = Partner.browse(partner_id)
|
||||
pl = Property.get('property_product_pricelist', Partner._name, '%s,%s' % (Partner._name, p.id))
|
||||
pl = Property.get('property_product_pricelist', Partner._name, '%s,%s' % (Partner._name, p.id)) or Property.get('property_product_pricelist', 'res.partner')
|
||||
if pl:
|
||||
pl = pl[0].id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user