From 256978195b45a6fb252665d71c41ec83155e9247 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Fri, 21 Aug 2015 12:15:57 +0200 Subject: [PATCH] [FIX] website_mail: action_edit_html Introduced by 9abf7a2010 When clicking on the many2one edition button of the field "email_registration_id" in the "event.event" view form, the return action id was not available in the action. closes #8147 opw:647698 --- addons/website_mail/models/email_template.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/website_mail/models/email_template.py b/addons/website_mail/models/email_template.py index 9a8c56b46fa..f6cf51b8778 100644 --- a/addons/website_mail/models/email_template.py +++ b/addons/website_mail/models/email_template.py @@ -10,7 +10,12 @@ class EmailTemplate(osv.Model): def action_edit_html(self, cr, uid, ids, context=None): if not len(ids) == 1: raise ValueError('One and only one ID allowed for this action') - url = '/website_mail/email_designer?model=email.template&res_id=%d&return_action=%d&enable_editor=1' % (ids[0], context['params']['action']) + if not context.get('params'): + action_id = self.pool['ir.model.data'].xmlid_to_res_id(cr, uid, 'mass_mailing.action_email_template_marketing') + else: + action_id = context['params']['action'] + + url = '/website_mail/email_designer?model=email.template&res_id=%d&return_action=%d&enable_editor=1' % (ids[0], action_id) return { 'name': _('Edit Template'), 'type': 'ir.actions.act_url',