[IMP] website_mail: make the template / mail editor work. We now have a limited
[odoo/odoo.git] / addons / website_mail / models / email_template.py
1 # -*- coding: utf-8 -*-
2
3 from openerp.osv import osv
4 from openerp.tools.translate import _
5
6
7 class EmailTemplate(osv.Model):
8     _inherit = 'email.template'
9
10     def action_edit_html(self, cr, uid, ids, context=None):
11         if not len(ids) == 1:
12             raise ValueError('One and only one ID allowed for this action')
13         url = '/website_mail/email_designer?model=email.template&res_id=%d&enable_editor=1' % (ids[0],)
14         return {
15             'name': _('Edit Template'),
16             'type': 'ir.actions.act_url',
17             'url': url,
18             'target': 'self',
19         }