From 81ade341f646af1e6dc4a7b8019fa64d257b4ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 15 Jun 2008 17:28:26 +0200 Subject: [PATCH] Add employee to context --- company.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/company.py b/company.py index 266380e4a8..3d7ee1a260 100644 --- a/company.py +++ b/company.py @@ -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):