[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.
This commit is contained in:
Denis Vermylen (dve)
2016-12-20 16:03:14 +01:00
parent 8a589ac143
commit 3068afd85a
+1 -1
View File
@@ -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: