flectra/addons/mass_mailing/controllers/web_editor.py

27 lines
1.3 KiB
Python
Raw Permalink Normal View History

# -*- coding: utf-8 -*-
2018-01-16 11:34:37 +01:00
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
2018-01-16 11:34:37 +01:00
from flectra import http
from flectra.http import request
from flectra.addons.web_editor.controllers.main import Web_Editor
class Web_Editor(Web_Editor):
@http.route(["/website_mass_mailing/field/popup_content"], type='http', auth="user")
def mass_mailing_FieldTextHtmlPopupTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs):
kwargs['snippets'] = '/website/snippets'
kwargs['template'] = 'mass_mailing.FieldTextHtmlPopupContent'
return self.FieldTextHtml(model, res_id, field, callback, **kwargs)
@http.route('/mass_mailing/field/email_template', type='http', auth="user")
def mass_mailing_FieldTextHtmlEmailTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs):
kwargs['snippets'] = '/mass_mailing/snippets'
kwargs['template'] = 'mass_mailing.FieldTextHtmlInline'
return self.FieldTextHtmlInline(model, res_id, field, callback, **kwargs)
@http.route(['/mass_mailing/snippets'], type='json', auth="user", website=True)
def mass_mailing_snippets(self):
values = {'company_id': request.env['res.users'].browse(request.uid).company_id}
return request.env.ref('mass_mailing.email_designer_snippets').render(values)