From c377eda65dc03a58c2001fa486aa690b4cc6ac16 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 5 Mar 2013 16:38:14 +0100 Subject: [PATCH] [ADD] (un)follow button bzr revid: mat@openerp.com-20130305153814-guthcma4mofytukg --- addons/hr/hr.py | 12 ++++++++++++ addons/hr/hr_view.xml | 25 ++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 467f34f708b..665af732d22 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -264,6 +264,18 @@ class hr_employee(osv.osv): image_path = addons.get_module_resource('hr', 'static/src/img', 'default_image.png') return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64')) + + def action_follow(self, cr, uid, ids, context=None): + """ Wrapper because message_subscribe_users take a user_ids=None + that receive the context without the wrapper. """ + return self.message_subscribe_users(cr, uid, ids, context=context) + + def action_unfollow(self, cr, uid, ids, context=None): + """ Wrapper because message_unsubscribe_users take a user_ids=None + that receive the context without the wrapper. """ + return self.message_unsubscribe_users(cr, uid, ids, context=context) + + _defaults = { 'active': 1, 'image': _get_default_image, diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 8767da6bd63..a5793e53eb0 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -27,23 +27,32 @@