From cb944d66ea941a3f80025f56d576677fa9d1c59c Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 17 Aug 2012 09:02:18 +0200 Subject: [IMP] mail message bzr revid: fp@tinyerp.com-20120817070218-rp1ssuhwnf8raitf --- addons/plugin/plugin_handler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index e497f902dc2..aaf54d1ac2b 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -108,8 +108,7 @@ class plugin_handler(osv.osv_memory): else: if model == 'res.partner': model_obj = self.pool.get('mail.thread') - res = self.pool.get(model).browse(cr, uid, [res_id]) - model_obj.message_append_dict(cr, uid, res, msg) + model_obj.message_append_note(cr, uid, [res_id], body=msg) notify = "Mail succefully pushed" url = self._make_url(cr, uid, res_id, model) -- cgit v1.2.3 From b62858e83e21bdd80aaf38b6d1149e6c66dc54e1 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 17 Aug 2012 12:03:02 +0200 Subject: [IMP] Merging different ways of posting a message: message_append_note message_append_dict message_append --> merged all to message_post bzr revid: fp@tinyerp.com-20120817100302-bqsqv23ogrchslew --- addons/plugin/plugin_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index aaf54d1ac2b..1bf3645d646 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -108,7 +108,7 @@ class plugin_handler(osv.osv_memory): else: if model == 'res.partner': model_obj = self.pool.get('mail.thread') - model_obj.message_append_note(cr, uid, [res_id], body=msg) + model_obj.message_post(cr, uid, [res_id], body=msg) notify = "Mail succefully pushed" url = self._make_url(cr, uid, res_id, model) -- cgit v1.2.3 From 06f60b3517cd160030ef2cc7758830604649fee9 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 17 Aug 2012 14:06:06 +0200 Subject: [FIX] body_text --> body, not ure it's good enough bzr revid: fp@tinyerp.com-20120817120606-t97l9x2dguuv7kmp --- addons/plugin/plugin_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 1bf3645d646..d493501e1cc 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -132,7 +132,7 @@ class plugin_handler(osv.osv_memory): return ('res.partner', partner_id, url) # Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts - def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body_text=False, body_html=False, attachments=False): + def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body=False, body_html=False, attachments=False): # ---------------------------------------- # solution 1 # construct a fake rfc822 from the separated arguement @@ -160,6 +160,6 @@ class plugin_handler(osv.osv_memory): attach_ids.append(ir_attachment_obj.create(cr, uid, vals)) mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) if mail_ids: - ids = mail_message.write(cr, uid,mail_ids[0],{ 'attachment_ids': [(6, 0, attach_ids)],'body_text':body_text,'body_html':body_html}) + ids = mail_message.write(cr, uid,mail_ids[0],{ 'attachment_ids': [(6, 0, attach_ids)],'body':body,'body_html':body_html}) url = self._make_url(cr, uid, res_id, model) return (model, res_id, url) -- cgit v1.2.3 From 5008e9cc84002797b2b4c8c43d10ab5e720bac8e Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 21 Aug 2012 23:15:28 +0200 Subject: [FIX] mail: fix parse_message calls for new signature - cr,uid needed bzr revid: odo@openerp.com-20120821211528-yyxyq1bqti5g3s5v --- addons/plugin/plugin_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index d493501e1cc..6d6262ddd22 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -44,7 +44,7 @@ class plugin_handler(osv.osv_memory): res_id = 0 url = "" name = "" - msg = mail_message_obj.parse_message(email) + msg = self.pool.get('mail.thread').parse_message(cr, uid, email) references = [msg.get('message-id')] refs = msg.get('references',False) if refs: @@ -91,7 +91,7 @@ class plugin_handler(osv.osv_memory): """ mail_message = self.pool.get('mail.message') model_obj = self.pool.get(model) - msg = mail_message.parse_message(email) + msg = self.pool.get('mail.thread').parse_message(cr, uid, email) message_id = msg.get('message-id') mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) @@ -146,7 +146,7 @@ class plugin_handler(osv.osv_memory): mail_message = self.pool.get('mail.message') ir_attachment_obj = self.pool.get('ir.attachment') attach_ids = [] - msg = mail_message.parse_message(headers) + msg = self.pool.get('mail.thread').parse_message(cr, uid, headers) message_id = msg.get('message-id') push_mail = self.push_message(cr, uid, model, headers, res_id) res_id = push_mail[1] -- cgit v1.2.3 From 406e58399fd1444cd5b83862d6493f59fcb08790 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 22 Aug 2012 13:34:39 +0200 Subject: [FIX] mail: unify message_post calls, fix typos, various lint cleanup bzr revid: odo@openerp.com-20120822113439-aoy7v4njs6o34tu5 --- addons/plugin/plugin_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 6d6262ddd22..9c582a8e3bf 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -101,15 +101,15 @@ class plugin_handler(osv.osv_memory): notify = "Email already pushed" elif res_id == 0: if model == 'res.partner': - notify = 'User the button Partner to create a new partner' + notify = 'User the Partner button to create a new partner' else: res_id = model_obj.message_new(cr, uid, msg) - notify = "Mail succefully pushed, a new %s has been created " % model + notify = "Mail succesfully pushed, a new %s has been created " % model else: if model == 'res.partner': model_obj = self.pool.get('mail.thread') model_obj.message_post(cr, uid, [res_id], body=msg) - notify = "Mail succefully pushed" + notify = "Mail succesfully pushed" url = self._make_url(cr, uid, res_id, model) return (model, res_id, url, notify) -- cgit v1.2.3