[IMP] crm, project, project_issue: reply_to address is now the alias of the parent section, project, project, if any.

bzr revid: tde@openerp.com-20130103170316-8n6d8u0h14dy4x48
This commit is contained in:
Thibault Delavallée 2013-01-03 18:03:16 +01:00
parent 4899a0df02
commit 8da57cbd2e
3 changed files with 15 additions and 0 deletions

View File

@ -966,6 +966,11 @@ class crm_lead(base_stage, format_address, osv.osv):
# Mail Gateway
# ----------------------------------------
def message_get_reply_to(self, cr, uid, ids, context=None):
""" Override to get the reply_to of the parent project. """
return [lead.section_id.message_get_reply_to()[0] if lead.section_id else False
for lead in self.browse(cr, uid, ids, context=context)]
def message_new(self, cr, uid, msg, custom_values=None, context=None):
""" Overrides mail_thread message_new that is called by the mailgateway
through message_process.

View File

@ -1166,6 +1166,11 @@ class task(base_stage, osv.osv):
# Mail gateway
# ---------------------------------------------------
def message_get_reply_to(self, cr, uid, ids, context=None):
""" Override to get the reply_to of the parent project. """
return [task.project_id.message_get_reply_to()[0] if task.project_id else False
for task in self.browse(cr, uid, ids, context=context)]
def message_new(self, cr, uid, msg, custom_values=None, context=None):
""" Override to updates the document according to the email. """
if custom_values is None: custom_values = {}

View File

@ -481,6 +481,11 @@ class project_issue(base_stage, osv.osv):
# Mail gateway
# -------------------------------------------------------
def message_get_reply_to(self, cr, uid, ids, context=None):
""" Override to get the reply_to of the parent project. """
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)]
def message_new(self, cr, uid, msg, custom_values=None, context=None):
""" Overrides mail_thread message_new that is called by the mailgateway
through message_process.