From 2264cf3f21bde2afbcd62a6b93598459fea1053e Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Wed, 20 Feb 2013 10:30:50 +0530 Subject: [IMP]:Outlook blugin for 32 and 64bit bzr revid: aja@tinyerp.com-20130220050050-oqk1tvi41uib20fc --- 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 0664af1c92e..434f557bca2 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -95,14 +95,13 @@ class plugin_handler(osv.osv_memory): msg = self.pool.get('mail.thread').message_parse(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)]) - if message_id and mail_ids : mail_record = mail_message.browse(cr, uid, mail_ids)[0] res_id = mail_record.res_id notify = "Email already pushed" elif res_id == 0: if model == 'res.partner': - notify = 'User the Partner button to create a new partner' + notify = 'Use the Partner button to create a new partner' else: res_id = model_obj.message_process(cr, uid, model, email) notify = "Mail successfully pushed, a new %s has been created " % model @@ -155,6 +154,7 @@ class plugin_handler(osv.osv_memory): push_mail = self.push_message(cr, uid, model, headers, res_id) res_id = push_mail[1] model = push_mail[0] + notify = push_mail[3] for name in attachments.keys(): attachment_ids = ir_attachment_obj.search(cr, uid, [('res_model', '=', model), ('res_id', '=', res_id), ('datas_fname', '=', name)]) if attachment_ids: @@ -166,4 +166,4 @@ class plugin_handler(osv.osv_memory): if mail_ids: 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) + return (model, res_id, url,notify) -- cgit v1.2.3 From 96ad6088540cc4cea5ea656f9350623cfecbc4a5 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 29 Mar 2013 15:37:20 +0100 Subject: [IMP] general: use registry[X] instead registry.get(X) when X is dynamic bzr revid: rco@openerp.com-20130329143720-80pkd4csemlk1aqz --- 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 0664af1c92e..b4b5064f2b1 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -57,7 +57,7 @@ class plugin_handler(osv.osv_memory): res_id = msg.res_id model = msg.model url = self._make_url(cr, uid, res_id, model) - name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1] + name = self.pool[model].name_get(cr, uid, [res_id])[0][1] return (model,res_id, url,name) def document_type(self, cr, uid, context=None): @@ -81,7 +81,7 @@ class plugin_handler(osv.osv_memory): @return : the result of name_search a list of tuple [(id, 'name')] """ - return self.pool.get(model).name_search(cr, uid, name) + return self.pool[model].name_search(cr, uid, name) def push_message(self, cr, uid, model, email, res_id=0): """ @@ -91,7 +91,7 @@ class plugin_handler(osv.osv_memory): @return Dictionary which contain model , url and resource id. """ mail_message = self.pool.get('mail.message') - model_obj = self.pool.get(model) + model_obj = self.pool[model] msg = self.pool.get('mail.thread').message_parse(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)]) -- cgit v1.2.3