diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 86930613212..ea59a66238b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -400,6 +400,19 @@ class crm_lead(crm_case, osv.osv): if case.state in CRM_LEAD_PENDING_STATES: values.update(state=crm.AVAILABLE_STATES[1][0]) #re-open res = self.write(cr, uid, [case.id], values, context=context) + + attachments = msg.get('attachments', {}) + self.history(cr, uid, ids, _('receive'), history=True, + subject = msg.get('subject'), + email = msg.get('to'), + details = msg.get('body'), + email_from = msg.get('from'), + email_cc = msg.get('cc'), + message_id = msg.get('message-id'), + references = msg.get('references', False) or msg.get('in-reply-to', False), + attach = attachments, + email_date = msg.get('date'), + context = context) return res def on_change_optin(self, cr, uid, ids, optin): diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index 5ad78c53465..04836a2ed79 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -254,6 +254,19 @@ class crm_claim(crm.crm_case, osv.osv): if case.state in CRM_CLAIM_PENDING_STATES: values.update(state=crm.AVAILABLE_STATES[1][0]) #re-open res = self.write(cr, uid, [case.id], values, context=context) + + attachments = msg.get('attachments', {}) + self.history(cr, uid, ids, _('receive'), history=True, + subject = msg.get('subject'), + email = msg.get('to'), + details = msg.get('body'), + email_from = msg.get('from'), + email_cc = msg.get('cc'), + message_id = msg.get('message-id'), + references = msg.get('references', False) or msg.get('in-reply-to', False), + attach = attachments, + email_date = msg.get('date'), + context = context) return res crm_claim() diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index c983acf78b3..9bfde3f189c 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -178,6 +178,19 @@ class crm_helpdesk(crm.crm_case, osv.osv): if case.state in CRM_HELPDESK_STATES: values.update(state=crm.AVAILABLE_STATES[1][0]) #re-open res = self.write(cr, uid, [case.id], values, context=context) + + attachments = msg.get('attachments', {}) + self.history(cr, uid, ids, _('receive'), history=True, + subject = msg.get('subject'), + email = msg.get('to'), + details = msg.get('body'), + email_from = msg.get('from'), + email_cc = msg.get('cc'), + message_id = msg.get('message-id'), + references = msg.get('references', False) or msg.get('in-reply-to', False), + attach = attachments, + email_date = msg.get('date'), + context = context) return res crm_helpdesk() diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 3931d053666..4951b7e21fa 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -377,6 +377,19 @@ class hr_applicant(crm.crm_case, osv.osv): vals.update(vls) res = self.write(cr, uid, ids, vals, context=context) + + attachments = msg.get('attachments', {}) + self.history(cr, uid, ids, _('receive'), history=True, + subject = msg.get('subject'), + email = msg.get('to'), + details = msg.get('body'), + email_from = msg.get('from'), + email_cc = msg.get('cc'), + message_id = msg.get('message-id'), + references = msg.get('references', False) or msg.get('in-reply-to', False), + attach = attachments, + email_date = msg.get('date'), + context = context) return res def case_open(self, cr, uid, ids, *args): diff --git a/addons/mail/email_thread.py b/addons/mail/email_thread.py index 87cd459608b..796fc35bb92 100644 --- a/addons/mail/email_thread.py +++ b/addons/mail/email_thread.py @@ -90,7 +90,7 @@ class email_thread(osv.osv): email_cc = msg.get('cc'), message_id = msg.get('message-id'), references = msg.get('references', False) or msg.get('in-reply-to', False), - attach = attachments.items(), + attach = attachments, email_date = msg.get('date'), context = context) return res_id @@ -115,7 +115,7 @@ class email_thread(osv.osv): email_cc = msg.get('cc'), message_id = msg.get('message-id'), references = msg.get('references', False) or msg.get('in-reply-to', False), - attach = attachments.items(), + attach = attachments, email_date = msg.get('date'), context = context) return True diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index c8b55067fc5..e9e5521d94b 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -454,6 +454,19 @@ class project_issue(crm.crm_case, osv.osv): vals.update(vls) res = self.write(cr, uid, ids, vals) + + attachments = msg.get('attachments', {}) + self.history(cr, uid, ids, _('receive'), history=True, + subject = msg.get('subject'), + email = msg.get('to'), + details = msg.get('body'), + email_from = msg.get('from'), + email_cc = msg.get('cc'), + message_id = msg.get('message-id'), + references = msg.get('references', False) or msg.get('in-reply-to', False), + attach = attachments, + email_date = msg.get('date'), + context = context) return res def copy(self, cr, uid, id, default=None, context=None): diff --git a/addons/project_mailgate/project_mailgate.py b/addons/project_mailgate/project_mailgate.py index 7610f35d648..dc0f04aeddf 100644 --- a/addons/project_mailgate/project_mailgate.py +++ b/addons/project_mailgate/project_mailgate.py @@ -69,7 +69,7 @@ class project_tasks(osv.osv): return res_id - def message_update(self, cr, uid, id, msg, data={}, default_act='pending'): + def message_update(self, cr, uid, ids, msg, data={}, default_act='pending'): thread_obj = self.pool.get('email.thread') msg_actions, body_data = thread_obj.msg_act_get(msg) data.update({ @@ -90,8 +90,21 @@ class project_tasks(osv.osv): if msg_actions['priority'] in ('1','2','3','4','5'): data['priority'] = msg_actions['priority'] - self.write(cr, uid, [id], data) - getattr(self,act)(cr, uid, [id]) + self.write(cr, uid, ids, data) + getattr(self,act)(cr, uid, ids) + + attachments = msg.get('attachments', {}) + self.history(cr, uid, ids, _('receive'), history=True, + subject = msg.get('subject'), + email = msg.get('to'), + details = msg.get('body'), + email_from = msg.get('from'), + email_cc = msg.get('cc'), + message_id = msg.get('message-id'), + references = msg.get('references', False) or msg.get('in-reply-to', False), + attach = attachments, + email_date = msg.get('date'), + context = context) return True def thread_followers(self, cr, uid, ids, context=None):