Fix company context domain when company is not in context
This commit is contained in:
1 parent
855f49a2b6
commit
73a3abaf18
1 file changed
+2
-1
@@ -18,7 +18,8 @@ class Sale(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', readonly=True, select=1)
|
||||
description = fields.Char('Description', states={
|
||||
'readonly': "state != 'draft'",
|
||||
|
||||
Reference in new issue
Block a user