From 6aba62a847daf134ea56e5421eae9496485b06ec Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Thu, 4 Oct 2012 12:32:27 +0530 Subject: [PATCH 1/4] [fix]fix problem of send RFQ bzr revid: pja@tinyerp.com-20121004070227-rqo5ec0mckj5vqx8 --- addons/email_template/email_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 1dc79dc634c..37dca4ceddb 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -319,7 +319,7 @@ class email_template(osv.osv): ext = "." + format if not report_name.endswith(ext): report_name += ext - attachments.append(report_name, result) + attachments.append((report_name, result)) # Add template attachments for attach in template.attachment_ids: From 50a7718e45014e5db1f2d304cc3b33a35c0baf8b Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Fri, 5 Oct 2012 18:48:04 +0530 Subject: [PATCH 2/4] [IMP]send mail (automated purchase order notification mail) bzr revid: pja@tinyerp.com-20121005131804-qliwjans60m08lhx --- addons/mail/wizard/mail_compose_message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index fbadf76f2fb..b0e2e89d795 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -81,7 +81,8 @@ class mail_compose_message(osv.TransientModel): elif composition_mode == 'comment' and model and res_id: vals = self.get_record_data(cr, uid, model, res_id, context=context) elif composition_mode == 'mass_mail' and model and active_ids: - vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'} + vals = self.pool.get('email.template').generate_email(cr, uid, context.get('default_template_id'), res_id, context=context) + vals.update({'content_subtype': 'html'}) else: vals = {'model': model, 'res_id': res_id} if composition_mode: From e676beaa3851a4476876206b8217db87a7acd92f Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Mon, 8 Oct 2012 11:41:46 +0530 Subject: [PATCH 3/4] [IMP]check condition bzr revid: pja@tinyerp.com-20121008061146-jz78eocp772xztob --- addons/mail/wizard/mail_compose_message.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index b0e2e89d795..87050ebb771 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -81,8 +81,11 @@ class mail_compose_message(osv.TransientModel): elif composition_mode == 'comment' and model and res_id: vals = self.get_record_data(cr, uid, model, res_id, context=context) elif composition_mode == 'mass_mail' and model and active_ids: - vals = self.pool.get('email.template').generate_email(cr, uid, context.get('default_template_id'), res_id, context=context) - vals.update({'content_subtype': 'html'}) + if context.get('default_template_id'): + vals = email_template_obj.generate_email(cr, uid, context.get('default_template_id'), res_id, context=context) + vals.update({'content_subtype': 'html'}) + else: + vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'} else: vals = {'model': model, 'res_id': res_id} if composition_mode: From e846176dfab08134de5727afee1dc7ec81f8f508 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Mon, 8 Oct 2012 12:47:31 +0530 Subject: [PATCH 4/4] [IMP]default_get method in mail_compose_message bzr revid: pja@tinyerp.com-20121008071731-ra4p1a2s5aiu4v4f --- addons/mail/wizard/mail_compose_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 87050ebb771..d4dcafeb038 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -82,7 +82,7 @@ class mail_compose_message(osv.TransientModel): vals = self.get_record_data(cr, uid, model, res_id, context=context) elif composition_mode == 'mass_mail' and model and active_ids: if context.get('default_template_id'): - vals = email_template_obj.generate_email(cr, uid, context.get('default_template_id'), res_id, context=context) + vals = self.pool.get('email.template').generate_email(cr, uid, context.get('default_template_id'), res_id, context=context) vals.update({'content_subtype': 'html'}) else: vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'}