From 73a3abaf18cc36ccdffbbe297eb77e8485248ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 2 Nov 2009 19:19:39 +0100 Subject: [PATCH] Fix company context domain when company is not in context --- sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'",