From 8da57cbd2ed6a073d558b0495ec68d923741c7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 3 Jan 2013 18:03:16 +0100 Subject: [PATCH] [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 --- addons/crm/crm_lead.py | 5 +++++ addons/project/project.py | 5 +++++ addons/project_issue/project_issue.py | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 3fae85f311d..6e484506223 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -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. diff --git a/addons/project/project.py b/addons/project/project.py index e98254d2fa1..40fb6bb4efd 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -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 = {} diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 8b2afb130e1..5a757fdac39 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -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.