diff --git a/sale.py b/sale.py index f9ed5b2381..6d0075474d 100644 --- a/sale.py +++ b/sale.py @@ -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'",