- add or fix decorators on methods - fix most compute methods (wrong dependencies) - revert changes in `eval_context` of `ir.actions` - various code simplifications and improvements - migrate methods that were not - ir_qweb: modify `QWebContext` to take an environment instead of `cr`, `uid`, `context` - ir_qweb: convert `AssetsBundle` to use new API `env` - ir_ui_view: use decorator `multi` on method `read_combined` - ir_ui_view: ensure that method `render` is never called with an xml_id - ir_ui_view: factor out part of the `ormcache` key of method `_read_template`
26 lines
1.2 KiB
Python
26 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from openerp import http
|
|
from openerp.http import request
|
|
from openerp.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)
|