Browse Source

[FIX] account_financial_report_webkit: force mako as jinja is new standard since saas-1

pull/7/merge
Jacques-Etienne Baudoux 11 years ago
parent
commit
66ce2210f8
  1. 14
      account_financial_report_webkit/report/webkit_parser_header_fix.py

14
account_financial_report_webkit/report/webkit_parser_header_fix.py

@ -41,7 +41,6 @@ from openerp import addons
from openerp import pooler from openerp import pooler
from openerp import tools from openerp import tools
from openerp.addons.report_webkit import webkit_report from openerp.addons.report_webkit import webkit_report
from openerp.addons.report_webkit.webkit_report import mako_template
from openerp.addons.report_webkit.report_helper import WebKitHelper from openerp.addons.report_webkit.report_helper import WebKitHelper
_logger = logging.getLogger('financial.reports.webkit') _logger = logging.getLogger('financial.reports.webkit')
@ -71,6 +70,19 @@ _logger = logging.getLogger('financial.reports.webkit')
# }) # })
# redefine mako_template as this is overriden by jinja since saas-1
# from openerp.addons.report_webkit.webkit_report import mako_template
def mako_template(text):
"""Build a Mako template.
This template uses UTF-8 encoding
"""
from mako.template import Template
from mako.lookup import TemplateLookup
tmp_lookup = TemplateLookup() #we need it in order to allow inclusion and inheritance
return Template(text, input_encoding='utf-8', output_encoding='utf-8', lookup=tmp_lookup)
class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): class HeaderFooterTextWebKitParser(webkit_report.WebKitParser):
def generate_pdf(self, comm_path, report_xml, header, footer, html_list, webkit_header=False): def generate_pdf(self, comm_path, report_xml, header, footer, html_list, webkit_header=False):

Loading…
Cancel
Save