Add employee to context

This commit is contained in:
Cédric Krier committed 2008-06-15 17:28:26 +02:00
1 parent 6b91ed008d
commit 81ade341f6
1 file changed
+5 -3
+5 -3
View File
@@ -91,12 +91,14 @@ class User(OSV):
return False
return True
def get_preferences(self, cursor, user, context_only=False, context=None):
res = super(User, self).get_preferences(cursor, user,
def get_preferences(self, cursor, user_id, context_only=False, context=None):
res = super(User, self).get_preferences(cursor, user_id,
context_only=context_only, context=context)
user = self.browse(cursor, 0, user_id, context=context)
if not context_only:
user = self.browse(cursor, 0, user, context=context)
res['main_company'] = user.main_company.id
if user.employee:
res['employee'] = user.employee.id
return res
def get_preferences_fields_view(self, cursor, user, context=None):