From 3068afd85ad3b73326017df2eff4f3eb924ff8e2 Mon Sep 17 00:00:00 2001 From: "Denis Vermylen (dve)" Date: Tue, 20 Dec 2016 16:03:14 +0100 Subject: [PATCH] [FIX] product: return id instead of recordset _get_partner_pricelist could return both a recordset or an ID. While the ORM handles both where the method is called, a migration script relies on an ID being returned. ( migrations/sale_contract/9.saas~13.1.1/pre-models.py", line 24 ) This commit ensures an ID is being returned every time. --- 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 d1922e347c9..c0151d2a0c7 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -300,7 +300,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)).id if not pl: if p.country_id.code: