From eb60a95c9b4ebfa6954bfaf59fef8189ed3ee8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 2 Nov 2009 19:11:19 +0100 Subject: [PATCH] Fix company context domain when company is not in context --- company.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/company.py b/company.py index 096e5ef2f8..7abb4eb2d1 100644 --- a/company.py +++ b/company.py @@ -182,7 +182,8 @@ User() class Property(ModelSQL, ModelView): _name = 'ir.property' company = fields.Many2One('company.company', 'Company', - domain=["('id', '=', context.get('company', 0))"]) + domain=["('id', 'company' in context and '=' or '!=', " \ + "context.get('company', 0))"]) def _set_values(self, cursor, user_id, name, model, res_id, val, field_id, context=None): @@ -207,7 +208,8 @@ Property() class Sequence(ModelSQL, ModelView): _name = 'ir.sequence' company = fields.Many2One('company.company', 'Company', - domain=["('id', '=', context.get('company', False))"]) + domain=["('id', 'company' in context and '=' or '!=', " \ + "context.get('company', 0))"]) def __init__(self): super(Sequence, self).__init__()