[IMP] Addons: propagated new automatic subscription mechanism.
bzr revid: tde@openerp.com-20120815205143-twthjirie2b5kr7n
This commit is contained in:
parent
3c733c508f
commit
92c70aa6ea
|
@ -859,10 +859,10 @@ class crm_lead(base_stage, osv.osv):
|
||||||
# OpenChatter methods and notifications
|
# OpenChatter methods and notifications
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' to the monitored fields """
|
||||||
res = super(crm_lead, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(crm_lead, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res.append('user_id')
|
return res + ['user_id']
|
||||||
|
|
||||||
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
||||||
""" Override of the (void) default notification method. """
|
""" Override of the (void) default notification method. """
|
||||||
|
|
|
@ -366,10 +366,11 @@ class hr_holidays(osv.osv):
|
||||||
result[obj.id] = hr_manager_group['users']
|
result[obj.id] = hr_manager_group['users']
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' and 'manager' to the monitored fields """
|
||||||
res = super(hr_holidays, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(hr_holidays, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res + ['user_id', 'employee_id.parent_id.user_id']
|
# TODO: add manager
|
||||||
|
return res + ['user_id']
|
||||||
|
|
||||||
def create_notificate(self, cr, uid, ids, context=None):
|
def create_notificate(self, cr, uid, ids, context=None):
|
||||||
for obj in self.browse(cr, uid, ids, context=context):
|
for obj in self.browse(cr, uid, ids, context=context):
|
||||||
|
|
|
@ -461,10 +461,10 @@ class hr_applicant(base_stage, osv.Model):
|
||||||
# OpenChatter methods and notifications
|
# OpenChatter methods and notifications
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' to the monitored fields """
|
||||||
res = super(hr_applicant, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(hr_applicant, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res.append('user_id')
|
return res + ['user_id']
|
||||||
|
|
||||||
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
||||||
""" Override of the (void) default notification method. """
|
""" Override of the (void) default notification method. """
|
||||||
|
|
|
@ -1046,10 +1046,10 @@ class mrp_production(osv.osv):
|
||||||
# OpenChatter methods and notifications
|
# OpenChatter methods and notifications
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' to the monitored fields """
|
||||||
res = super(mrp_production, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(mrp_production, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res.append('user_id')
|
return res + ['user_id']
|
||||||
|
|
||||||
def create_send_note(self, cr, uid, ids, context=None):
|
def create_send_note(self, cr, uid, ids, context=None):
|
||||||
self.message_append_note(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), context=context)
|
self.message_append_note(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), context=context)
|
||||||
|
|
|
@ -514,10 +514,10 @@ def Project():
|
||||||
# OpenChatter methods and notifications
|
# OpenChatter methods and notifications
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' to the monitored fields """
|
||||||
res = super(project, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(project, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res.append('user_id')
|
return res + ['user_id']
|
||||||
|
|
||||||
def create(self, cr, uid, vals, context=None):
|
def create(self, cr, uid, vals, context=None):
|
||||||
if context is None: context = {}
|
if context is None: context = {}
|
||||||
|
@ -1201,9 +1201,9 @@ class task(base_stage, osv.osv):
|
||||||
result[obj.id].append(obj.user_id.id)
|
result[obj.id].append(obj.user_id.id)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' and 'manager_id' to the monitored fields """
|
||||||
res = super(task, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(task, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res + ['user_id', 'manager_id']
|
return res + ['user_id', 'manager_id']
|
||||||
|
|
||||||
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
||||||
|
|
|
@ -499,10 +499,10 @@ class project_issue(base_stage, osv.osv):
|
||||||
# OpenChatter methods and notifications
|
# OpenChatter methods and notifications
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|
||||||
def message_get_follower_fields(self, cr, uid, ids, context=None):
|
def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
|
||||||
""" Override to add 'user_id' field to automatic subscription. """
|
""" Add 'user_id' to the monitored fields """
|
||||||
res = super(project_issue, self).message_get_follower_fields(cr, uid, ids, context=context)
|
res = super(project_issue, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
|
||||||
return res.append('user_id')
|
return res + ['user_id']
|
||||||
|
|
||||||
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
|
||||||
""" Override of the (void) default notification method. """
|
""" Override of the (void) default notification method. """
|
||||||
|
|
Loading…
Reference in New Issue