From 4d3b805cf935bf775ab103ff5ad2c7f4310d3bdb Mon Sep 17 00:00:00 2001 From: "Rifakat Haradwala (Open ERP)" Date: Mon, 4 Apr 2011 16:12:03 +0530 Subject: [PATCH] [IMP] mail: improvements in email message form view and removed msg.get_unixfrom() causing errors and corrected it in email_thread.py bzr revid: rha@tinyerp.com-20110404104203-g6ksbb0q6zz5y9sp --- addons/crm/crm_lead.py | 3 ++- addons/crm_claim/crm_claim.py | 3 ++- addons/crm_helpdesk/crm_helpdesk.py | 3 ++- addons/mail/email_thread.py | 2 +- addons/mail/email_view.xml | 28 +++++++++++----------------- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 31a61f86f47..7844a9e8037 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -325,6 +325,7 @@ class crm_lead(crm_case, osv.osv): @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks + @param msg: dictionary object to contain email message data """ thread_pool = self.pool.get('email.thread') @@ -343,7 +344,7 @@ class crm_lead(crm_case, osv.osv): if msg.get('priority', False): vals['priority'] = priority - res = thread_pool.get_partner(cr, uid, msg.get('from') or msg.get_unixfrom()) + res = thread_pool.get_partner(cr, uid, msg.get('from', False)) if res: vals.update(res) diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index 982d7058e6c..3b3c02f980f 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -179,6 +179,7 @@ class crm_claim(crm.crm_case, osv.osv): @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks + @param msg: dictionary object to contain email message data """ thread_pool = self.pool.get('email.thread') @@ -197,7 +198,7 @@ class crm_claim(crm.crm_case, osv.osv): if msg.get('priority', False): vals['priority'] = priority - res = thread_pool.get_partner(cr, uid, msg.get('from') or msg.get_unixfrom()) + res = thread_pool.get_partner(cr, uid, msg.get('from', False)) if res: vals.update(res) diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index 4e0289bcff0..6dce6cdd2ef 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -103,6 +103,7 @@ class crm_helpdesk(crm.crm_case, osv.osv): @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks + @param msg: dictionary object to contain email message data """ thread_pool = self.pool.get('email.thread') @@ -121,7 +122,7 @@ class crm_helpdesk(crm.crm_case, osv.osv): if msg.get('priority', False): vals['priority'] = priority - res = thread_pool.get_partner(cr, uid, msg.get('from') or msg.get_unixfrom()) + res = thread_pool.get_partner(cr, uid, msg.get('from', False)) if res: vals.update(res) diff --git a/addons/mail/email_thread.py b/addons/mail/email_thread.py index 23cfd8595ab..afe08df20b2 100644 --- a/addons/mail/email_thread.py +++ b/addons/mail/email_thread.py @@ -292,7 +292,7 @@ class email_thread(osv.osv): msg['content-type'] = msg_txt.get('Content-Type') if 'From' in fields: - msg['from'] = self._decode_header(msg_txt.get('From')) + msg['from'] = self._decode_header(msg_txt.get('From') or msg_txt.get_unixfrom()) if 'Delivered-To' in fields: msg['to'] = self._decode_header(msg_txt.get('Delivered-To')) diff --git a/addons/mail/email_view.xml b/addons/mail/email_view.xml index a977b95bb1d..9f933200b18 100644 --- a/addons/mail/email_view.xml +++ b/addons/mail/email_view.xml @@ -16,6 +16,7 @@ + @@ -31,21 +32,20 @@ - +