[FIX]product: force_company doesn't work to get property

When forcing the company C in the context, the company C was not
taken into account in function _get_partner_pricelist

opw:1861989
This commit is contained in:
Florent de Labarre
2018-07-04 16:24:17 +02:00
committed by Goffin Simon
parent f56ad6daf8
commit 4206aba48b
+2 -1
View File
@@ -18,7 +18,8 @@ class Partner(models.Model):
def _compute_product_pricelist(self):
for p in self:
if not isinstance(p.id, models.NewId): # if not onchange
p.property_product_pricelist = self.env['product.pricelist']._get_partner_pricelist(p.id)
company = self.env.context.get('force_company', False)
p.property_product_pricelist = self.env['product.pricelist'].sudo()._get_partner_pricelist(p.id, company_id=company)
@api.one
def _inverse_product_pricelist(self):