Fix company context domain when company is not in context
This commit is contained in:
1 parent
37b3af3f4e
commit
7fecc72fd3
1 file changed
+4
-2
+4
-2
@@ -22,7 +22,8 @@ class Purchase(ModelWorkflow, ModelSQL, ModelView):
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
states={
|
||||
'readonly': "state != 'draft' or bool(lines)",
|
||||
}, domain=["('id', '=', context.get('company', 0))"])
|
||||
}, domain=["('id', 'company' in context and '=' or '!=', " \
|
||||
"context.get('company', 0))"])
|
||||
reference = fields.Char('Reference', size=None, readonly=True, select=1)
|
||||
supplier_reference = fields.Char('Supplier Reference', select=1)
|
||||
description = fields.Char('Description', size=None, states=_STATES)
|
||||
@@ -1525,7 +1526,8 @@ class ProductSupplier(ModelSQL, ModelView):
|
||||
'product_supplier', 'Prices')
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
ondelete='CASCADE', select=1,
|
||||
domain=["('id', '=', context.get('company', 0))"])
|
||||
domain=["('id', 'company' in context and '=' or '!=', " \
|
||||
"context.get('company', 0))"])
|
||||
delivery_time = fields.Integer('Delivery Time',
|
||||
help="In number of days")
|
||||
|
||||
|
||||
Reference in new issue
Block a user