summaryrefslogtreecommitdiff
path: root/addons/website_sale/models
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2019-11-26 07:59:09 +0000
committerXavier Morel <xmo@odoo.com>2019-11-27 13:41:49 +0000
commitde5263179518e8097e21383f6e837023edbc1209 (patch)
treeee09fe70af7b949390c389dafffd4216019d160e /addons/website_sale/models
parent29cb942868b301d5063b8d250cf95ff9edc48ec4 (diff)
[REM] website_sale: dynamic domain
closes odoo/odoo#40962 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/website_sale/models')
-rw-r--r--addons/website_sale/models/product.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py
index 6ca5d0e5314..5d56b3a3a90 100644
--- a/addons/website_sale/models/product.py
+++ b/addons/website_sale/models/product.py
@@ -30,7 +30,7 @@ class ProductPricelist(models.Model):
domain = [('company_id', '=', company_id)]
return self.env['website'].search(domain, limit=1)
- website_id = fields.Many2one('website', string="Website", ondelete='restrict', default=_default_website)
+ website_id = fields.Many2one('website', string="Website", ondelete='restrict', default=_default_website, domain="[('company_id', '=?', company_id)]")
code = fields.Char(string='E-commerce Promotional Code', groups="base.group_user")
selectable = fields.Boolean(help="Allow the end user to choose this price list")
@@ -119,12 +119,6 @@ class ProductPricelist(models.Model):
company_id = website.company_id.id
return super(ProductPricelist, self)._get_partner_pricelist_multi(partner_ids, company_id)
- @api.onchange('company_id')
- def _onchange_company_id(self):
- ''' Show only the company's website '''
- domain = self.company_id and [('company_id', '=', self.company_id.id)] or []
- return {'domain': {'website_id': domain}}
-
@api.constrains('company_id', 'website_id')
def _check_websites_in_company(self):
'''Prevent misconfiguration multi-website/multi-companies.