[FIX] product: fallback on global partner property after the country groups matching
Default porperty was overriding localization filter.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user