diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-05-19 10:19:45 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-05-26 15:50:11 +0200 |
| commit | 4afa747fa1bc99e5626636541a2dabb22c7f22cd (patch) | |
| tree | 4de41548363a800da127e6e988166ad825fcb1e2 /addons/product | |
| parent | 8f578637076d4b65de222aa092ce738391ce5260 (diff) | |
[IMP] *: make ir.property methods private
Should only interact with them via python code in a controlled
environment, no direct call with RPC
Diffstat (limited to 'addons/product')
| -rw-r--r-- | addons/product/models/product_pricelist.py | 4 | ||||
| -rw-r--r-- | addons/product/models/res_company.py | 4 | ||||
| -rw-r--r-- | addons/product/models/res_partner.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index 4938c9c313b..680ed729cf9 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -340,7 +340,7 @@ class Pricelist(models.Model): pl_domain = self._get_partner_pricelist_multi_search_domain_hook(company_id) # if no specific property, try to find a fitting pricelist - result = Property.get_multi('property_product_pricelist', Partner._name, partner_ids) + result = Property._get_multi('property_product_pricelist', Partner._name, partner_ids) remaining_partner_ids = [pid for pid, val in result.items() if not val or not val._get_partner_pricelist_multi_filter_hook()] @@ -348,7 +348,7 @@ class Pricelist(models.Model): # get fallback pricelist when no pricelist for a given country pl_fallback = ( Pricelist.search(pl_domain + [('country_group_ids', '=', False)], limit=1) or - Property.get('property_product_pricelist', 'res.partner') or + Property._get('property_product_pricelist', 'res.partner') or Pricelist.search(pl_domain, limit=1) ) # group partners by country, and find a pricelist for each country diff --git a/addons/product/models/res_company.py b/addons/product/models/res_company.py index 94e053eda23..323d722fb87 100644 --- a/addons/product/models/res_company.py +++ b/addons/product/models/res_company.py @@ -18,7 +18,7 @@ class ResCompany(models.Model): 'name': _("Default %(currency)s pricelist") % params, 'currency_id': new_company.currency_id.id, }) - self.env['ir.property'].sudo().set_default( + self.env['ir.property'].sudo()._set_default( 'property_product_pricelist', 'res.partner', pricelist, @@ -54,7 +54,7 @@ class ResCompany(models.Model): 'name': _("Default %(currency)s pricelist") % params, 'currency_id': currency_id, }) - self.env['ir.property'].sudo().set_default( + self.env['ir.property'].sudo()._set_default( 'property_product_pricelist', 'res.partner', pricelist, diff --git a/addons/product/models/res_partner.py b/addons/product/models/res_partner.py index 786923ef5a4..f76c0e4da63 100644 --- a/addons/product/models/res_partner.py +++ b/addons/product/models/res_partner.py @@ -29,11 +29,11 @@ class Partner(models.Model): limit=1 ) default_for_country = pls and pls[0] - actual = self.env['ir.property'].get('property_product_pricelist', 'res.partner', 'res.partner,%s' % partner.id) + actual = self.env['ir.property']._get('property_product_pricelist', 'res.partner', 'res.partner,%s' % partner.id) # update at each change country, and so erase old pricelist if partner.property_product_pricelist or (actual and default_for_country and default_for_country.id != actual.id): # keep the company of the current user before sudo - self.env['ir.property'].sudo().set_multi( + self.env['ir.property'].sudo()._set_multi( 'property_product_pricelist', partner._name, {partner.id: partner.property_product_pricelist or default_for_country.id}, |
