Odoo Help


Webkit Reports 8. Can't get variable in mako

on 1/8/15, 10:39 AM 1,014 views

Hi everyone. Can't get variable in my mako report like that - ${fun('123')}. The code below seems correct, but I get in log: 'fun is undefined'.

Maybe, the path to my mako-html file isn't correct. I don't know. But I've tried a lot of path and no result...


class main_report_parser(report_sxw.rml_parse):

       def __init__(self, cr, uid, name, context):

             super(main_report_parser, self).__init__(cr, uid, name, context=context) 
             self.localcontext.update({'fun': self.getGTD})

       def getGTD(self, word): 

              return word

report_sxw.report_sxw('report.account.report_invoice', 'account.invoice', 'new/l10n_ru_doc/report/invoice.htm', parser=main_report_parser)

Thank you a lot

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: 1/8/15, 10:39 AM
Seen: 1014 times
Last updated: 4/6/15, 6:08 AM