From eb90e1113475c02423d94943cb0204c39fc7be7c Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 16 Sep 2016 14:47:04 +0200 Subject: [PATCH] [FIX] product: fallback on global partner property after the country groups matching Default porperty was overriding localization filter. --- addons/product/models/product_pricelist.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index e942ee742d5..d1922e347c9 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -307,14 +307,19 @@ class Pricelist(models.Model): pls = self.env['product.pricelist'].search([('country_group_ids.country_ids.code', '=', p.country_id.code)], limit=1) pl = pls and pls[0].id - if not pl: - pl = Property.get('property_product_pricelist', 'res.partner').id - if not pl: # search pl where no country pls = self.env['product.pricelist'].search([('country_group_ids', '=', False)], limit=1) pl = pls and pls[0].id + if not pl: + prop = Property.get('property_product_pricelist', 'res.partner') + pl = prop and prop[0].id + + if not pl: + pls = self.env['product.pricelist'].search([], limit=1) + pl = pls and pls[0].id + return pl