From e65b472cb50255ed082dc3d60658962037c065d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 27 Mar 2014 15:12:41 +0100 Subject: [PATCH] [IMP] email_template: previw improvements : - usability improveemnts on the sample document, more clear - add partner_ids fields, displaying result of email template rendering that now also generated partner_ids that will be recipient_ids on a mail_mail - added attachment display bzr revid: tde@openerp.com-20140327141241-2w2lxj5hkq8nqcu5 --- .../email_template/wizard/email_template_preview.py | 3 ++- .../wizard/email_template_preview_view.xml | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/email_template/wizard/email_template_preview.py b/addons/email_template/wizard/email_template_preview.py index 5fee415a75e..104437ec0d3 100644 --- a/addons/email_template/wizard/email_template_preview.py +++ b/addons/email_template/wizard/email_template_preview.py @@ -66,6 +66,7 @@ class email_template_preview(osv.osv_memory): _columns = { 'res_id': fields.selection(_get_records, 'Sample Document'), + 'partner_ids': fields.many2many('res.partner', string='Recipients'), } def on_change_res_id(self, cr, uid, ids, res_id, context=None): @@ -80,7 +81,7 @@ class email_template_preview(osv.osv_memory): # generate and get template values mail_values = email_template.generate_email(cr, uid, template_id, res_id, context=context) - vals = dict((field, mail_values.get(field, False)) for field in ('email_from', 'email_to', 'email_cc', 'reply_to', 'subject', 'body_html', 'partner_to')) + vals = dict((field, mail_values.get(field, False)) for field in ('email_from', 'email_to', 'email_cc', 'reply_to', 'subject', 'body_html', 'partner_to', 'partner_ids', 'attachment_ids')) vals['name'] = template.name return {'value': vals} diff --git a/addons/email_template/wizard/email_template_preview_view.xml b/addons/email_template/wizard/email_template_preview_view.xml index 6d61658dcdc..87c1e92fa60 100644 --- a/addons/email_template/wizard/email_template_preview_view.xml +++ b/addons/email_template/wizard/email_template_preview_view.xml @@ -8,14 +8,17 @@
-

Preview of

- Using sample document +

Preview of

+ Choose an example record: + - - + + +