Fix company context domain when company is not in context

(transplanted from bd5b84915e07ee15f66015464d9952f81d5fa5d9)
This commit is contained in:
Cédric Krier committed 2009-11-02 19:19:39 +01:00
1 parent 7da79fbad6
commit 1c756c3276
1 file changed
+2 -1
+2 -1
View File
@@ -17,7 +17,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'",