[IMP] hr_recruitment, project_issue: now use the suggested_recipient feature, like crm.lead.
bzr revid: tde@openerp.com-20130226132241-ot3xfn8u39grp0ir
This commit is contained in:
parent
093f37e7d5
commit
2d3ff2a217
|
@ -340,6 +340,15 @@ class hr_applicant(base_stage, osv.Model):
|
||||||
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context=context)
|
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context=context)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
|
||||||
|
recipients = super(hr_applicant, self).message_get_suggested_recipients(cr, uid, ids, context=context)
|
||||||
|
for applicant in self.browse(cr, uid, ids, context=context):
|
||||||
|
if applicant.partner_id:
|
||||||
|
self._message_add_suggested_recipient(recipients, applicant, partner=applicant.partner_id, reason=_('Contact'))
|
||||||
|
elif applicant.email_from:
|
||||||
|
self._message_add_suggested_recipient(recipients, applicant, email=applicant.email_from, reason=_('Contact Email'))
|
||||||
|
return recipients
|
||||||
|
|
||||||
def message_new(self, cr, uid, msg, custom_values=None, context=None):
|
def message_new(self, cr, uid, msg, custom_values=None, context=None):
|
||||||
""" Overrides mail_thread message_new that is called by the mailgateway
|
""" Overrides mail_thread message_new that is called by the mailgateway
|
||||||
through message_process.
|
through message_process.
|
||||||
|
|
|
@ -485,6 +485,15 @@ class project_issue(base_stage, osv.osv):
|
||||||
return [issue.project_id.message_get_reply_to()[0] if issue.project_id else False
|
return [issue.project_id.message_get_reply_to()[0] if issue.project_id else False
|
||||||
for issue in self.browse(cr, uid, ids, context=context)]
|
for issue in self.browse(cr, uid, ids, context=context)]
|
||||||
|
|
||||||
|
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
|
||||||
|
recipients = super(project_issue, self).message_get_suggested_recipients(cr, uid, ids, context=context)
|
||||||
|
for issue in self.browse(cr, uid, ids, context=context):
|
||||||
|
if issue.partner_id:
|
||||||
|
self._message_add_suggested_recipient(recipients, issue, partner=issue.partner_id, reason=_('Customer'))
|
||||||
|
elif issue.email_from:
|
||||||
|
self._message_add_suggested_recipient(recipients, issue, email=issue.email_from, reason=_('Customer Email'))
|
||||||
|
return recipients
|
||||||
|
|
||||||
def message_new(self, cr, uid, msg, custom_values=None, context=None):
|
def message_new(self, cr, uid, msg, custom_values=None, context=None):
|
||||||
""" Overrides mail_thread message_new that is called by the mailgateway
|
""" Overrides mail_thread message_new that is called by the mailgateway
|
||||||
through message_process.
|
through message_process.
|
||||||
|
|
Loading…
Reference in New Issue