Odoo Help

Welcome!

This community 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.

1

Webkit Reports 8. Can't get variable in mako

By
Keywoker
on 1/8/15, 10:39 AM 652 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/8/15, 10:39 AM
Seen: 652 times
Last updated: 4/6/15, 6:08 AM