Files
odoo_source/addons/website_mail/models/email_template.py
T
Nicolas Lempereur 9abf7a2010 [FIX] mass mailing: keep menu when back in backend
The menu was not present in 8.0 when going back from the mass mailing email
composer to the backend. This fix adds the current action id as a return_action
query string parameter and return to the correct action.

fixes #5591

opw-629526
2015-03-10 13:51:08 +01:00

20 lines
636 B
Python

# -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp.tools.translate import _
class EmailTemplate(osv.Model):
_inherit = 'email.template'
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'])
return {
'name': _('Edit Template'),
'type': 'ir.actions.act_url',
'url': url,
'target': 'self',
}