From 6149b0d9957fcb898eae25b5b8a92c1eca5b9aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 28 Feb 2012 15:07:30 +0100 Subject: [PATCH] [IMP] hr_holidays: deleted automatic subscription creation, now delegated to mail.thread (user that creates is automatically subscribed) and message_get_subscribers (manager is always considered as subscribed) bzr revid: tde@openerp.com-20120228140730-xke7ys2j2vcx3ruo --- addons/hr_holidays/hr_holidays.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 78db0dc7063..f63dcf9632d 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -358,12 +358,16 @@ class hr_holidays(osv.osv): # OpenChatter and notifications # ----------------------------- + def message_get_subscribers(self, cr, uid, ids, context=None): + sub_ids = self._message_get_subscribers_ids(cr, uid, ids, context=context); + # add the employee and its manager if specified to the subscribed users + for obj in self.browse(cr, uid, ids, context=context): + if obj.employee_id.parent_id: + sub_ids.append(obj.employee_id.parent_id.user_id.id) + return self.pool.get('res.users').read(cr, uid, sub_ids, context=context) + def create_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - # add the employee and its manager if specified to the subscribed users - self.message_subscribe(cr, uid, ids, [obj.employee_id.user_id.id], context=context) - if obj.employee_id.parent_id: - self.message_subscribe(cr, uid, ids, [obj.employee_id.parent_id.user_id.id], context=context) self.message_append_note(cr, uid, ids, _('System notification'), _("The %s request '%s' has been created and is waiting confirmation") % ('leave' if obj.type == 'remove' else 'allocation', obj.name), type='notification', context=context)