Community mailing list archives


Re: Custom Qweb Report

- 06/29/2015 11:19:22
I think the right way to do it is using a parser class. In there you create yout function and its easier than working on the report object. Maybe someone else can vouch for this. 

2015-06-27 3:43 GMT-06:00 Fermin Arellano <>:

I am trying to generate a PDF report for Employee's contracts. I was able to pull fields from the hr.contract and hr.employee models. But I am trying to display for example the following things as well, which are not straight forward fields:

- Employee´s age (Calculated from hr.employee.birthday)
- Employee's wage in words (Calculated from hr.contract.wage)  
- - - 125 = One hundred and twenty five
- and other fields...

I know I need to do my own functions for this and call them from my Qweb template. 

My question is which approach should I use, 
- Create a parse class, as depicted here   OR
- Create a custom report, as depicted here

If you know of any other method, or a better example I can follow. I will be very grateful if you are willing to share it. 

Hope you can give a push towards the right direction. Greetings!

Post to: