diff --git a/sale.py b/sale.py index 34120241ca..5d1e74b564 100644 --- a/sale.py +++ b/sale.py @@ -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'",