Odoo Help


Has anybody tested webkit reports with OE trunk ?

Anas ea
on 3/11/14, 11:05 AM 2,498 views

I'm trying to use webkit reports in openerp trunk installation but no success :

report_webkit module installs fine I tried with invoice_webkit I get this error when I try to print :

ERROR testing openerp.service.report: Exception: Encountered unknown tag 'page'. Traceback (most recent call last): File "/home/openerp/source/server/openerp/service/report.py", line 92, in go result, format = openerp.report.render_report(cr, uid, ids, object, datas, context) File "/home/openerp/source/server/openerp/report/__init__.py", line 40, in render_report return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context) File "/home/openerp/source/server/openerp/addons/base/ir/ir_actions.py", line 128, in render_report return new_report.create(cr, uid, res_ids, data, context) File "/home/openerp/source/addons/report_webkit/webkit_report.py", line 392, in create result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context) File "/home/openerp/source/server/openerp/report/report_sxw.py", line 492, in create_source_pdf result = self.create_single_pdf(cr, uid, [obj.id], data, report_xml, context) File "/home/openerp/source/addons/report_webkit/webkit_report.py", line 311, in create_single_pdf body_mako_tpl = mako_template(template) File "/home/openerp/source/addons/report_webkit/webkit_report.py", line 87, in mako_template return mako_template_env.from_string(text) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 841, in from_string return cls.from_code(self, self.compile(source), globals, None) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 554, in compile self.handle_exception(exc_info, source_hint=source) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File "<unknown>", line 134, in template

TemplateSyntaxError: Encountered unknown tag 'page'. 2014-03-11 13:23:38,839 28349 ERROR testing openerp.addons.web.controllers.main: An exception occured during an http request Traceback (most recent call last): File "/home/openerp/source/web/addons/web/controllers/main.py", line 102, in wrap return f(args, *kwargs) File "/home/openerp/source/web/addons/web/controllers/main.py", line 1818, in index request.session.db, request.session.uid, request.session.password, report_id) File "/home/openerp/source/server/openerp/http.py", line 591, in proxy_method result = openerp.netsvc.dispatch_rpc(self.service_name, method, args) File "/home/openerp/source/server/openerp/netsvc.py", line 236, in dispatch_rpc result = dispatch(method, params) File "/home/openerp/source/server/openerp/service/report.py", line 34, in dispatch res = fn(db, uid, *params) File "/home/openerp/source/server/openerp/service/report.py", line 140, in exp_report_get return _check_report(report_id) File "/home/openerp/source/server/openerp/service/report.py", line 118, in _check_report raise openerp.osv.orm.except_orm(exc.message, exc.traceback) except_orm: (u"Encountered unknown tag 'page'.", (<class 'jinja2.exceptions.templatesyntaxerror'="">, TemplateSyntaxError("Encountered unknown tag 'page'.",), <traceback object="" at="" 0x7f00742be0e0="">))

Any ideas ?

Tom Blauwendraat
On 3/19/15, 11:58 AM

In Odoo 8, report_webkit now uses a Jinja2 sandboxed environment to render Mako templates, which doesn't cover the full Mako syntax.

In report_webkit/webkit_report.py:

54 # We use a jinja2 sandboxed environment to render mako templates.

55 # Note that the rendering does not cover all the mako syntax,

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/11/14, 11:05 AM
Seen: 2498 times
Last updated: 3/19/15, 11:58 AM