From 6ec309a3bde7f5dbf6684ea17fbfe13876fc2713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 12 Dec 2013 12:12:51 +0100 Subject: [PATCH] Check for company and employee in transaction context review2261002 --- company.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/company.py b/company.py index 15f42839c3..bfccdc986e 100644 --- a/company.py +++ b/company.py @@ -221,7 +221,8 @@ class User: values = vals break if values: - if 'company' in fields_names: + if ('company' in fields_names + and 'company' in Transaction().context): main_company_id = values.get('main_company') if not main_company_id: main_company_id = cls.read([user_id], @@ -233,7 +234,8 @@ class User: if ((company_id and company_id in map(int, companies)) or not company_id): values['company'] = company_id - if 'employee' in fields_names: + if ('employee' in fields_names + and 'employee' in Transaction().context): employees = values.get('employees') if not employees: employees = cls.read([user_id],