Search code examples
odooodoo-9

How can I convert Gregorian dates to Persian (Jalali) date in all Odoo pdf reports?


Is there a way to convert dates in Odoo pdf prints to its Persian (Jalali) equivalent?

I know how to convert a Gregorian date to Persian date, but I want to know where to apply it for each report.

Thanks in advance


Solution

  • You just need to inherit the "value_to_html" method in both "DateConverter" and "DateTimeConverter" classes in ir_qweb.py and convert the input value to jalali date. You can use this link in case you need a python jalali date converter.