From 7f989b94b02bb7daf9cce964bdde078aac794033 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 14 Nov 2017 14:25:36 +0100 Subject: [PATCH] [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 --- addons/product/models/product_pricelist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index fd2bfdb9dec..a1bf5527b99 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -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