Check for company and employee in transaction context

review2261002
This commit is contained in:
Nicolas Évrard committed 2013-12-12 12:12:51 +01:00
1 parent 87ee7fb747
commit 6ec309a3bd
1 file changed
+4 -2
+4 -2
View File
@@ -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],