summaryrefslogtreecommitdiff
path: root/addons/sale_crm
diff options
context:
space:
mode:
authorPrakash Prajapati <ppr@odoo.com>2019-07-30 11:26:58 +0000
committerYannick Tivisse <yti@odoo.com>2019-08-16 11:17:28 +0000
commitc058562d7301298fd71b2618b5386611dfeb81cb (patch)
tree33e415704316c3da0ec08b4dd3168bdec9bca8d6 /addons/sale_crm
parent25714692b23624d04a43862db26ebcf802b89399 (diff)
[IMP] various: Add multi company domains on views
When the many2xxx field relates to a model where company_id is required, set this domain [('company_id','=',company_id.id)] When the company_id field of the related model is not required, set this domain ['|',('company_id','=',company_id.id),('company_id','=',False)] When setting the domain on a field which is in the treeview of a xxx2many field evaluate against the company_id of the 'parent'. Some constraints have been added on sereval models. Take a look at the complete specification for more details. TaskID: 2024446 Closes: #35266 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/sale_crm')
-rw-r--r--addons/sale_crm/models/sale_order.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_crm/models/sale_order.py b/addons/sale_crm/models/sale_order.py
index e635f2fe81b..80696686e3e 100644
--- a/addons/sale_crm/models/sale_order.py
+++ b/addons/sale_crm/models/sale_order.py
@@ -8,4 +8,4 @@ class SaleOrder(models.Model):
_inherit = 'sale.order'
tag_ids = fields.Many2many('crm.lead.tag', 'sale_order_tag_rel', 'order_id', 'tag_id', string='Tags')
- opportunity_id = fields.Many2one('crm.lead', string='Opportunity', domain="[('type', '=', 'opportunity')]")
+ opportunity_id = fields.Many2one('crm.lead', string='Opportunity', domain="[('type', '=', 'opportunity'), '|', ('company_id', '=', False), ('company_id', '=', company_id)]")