Fix company context domain when company is not in context

This commit is contained in:
Cédric Krier committed 2009-11-02 19:19:39 +01:00
1 parent 855f49a2b6
commit 73a3abaf18
1 file changed
+2 -1
+2 -1
View File
@@ -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'",