webkit_report : setLang() doesn't work!
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In the webkit report, the setLang() is not working as per the standard.
Reason : Normal reports work fine because setLang() assigns the context to the objects fetched from getObjects(). While in webkit, we call different parser for report engine, setLang is part of i t and 2nd parser is th class which is defined for report.
To get an effect of setLang(), you would normally need to do this:
In the definition of your parser(report class),override set_context and do something like:
def set_context(self, objects, data, ids, report_type=None):
for ob in objects:
super call
If you do this, the header, footer and body will have an impact of new lang all over.
If in case,you dont' do this, nothing gets translated.
As a solution on global level, you would opt to follow what normal parser does, its in the attached patch.
Hope this really helps.
Correct me if I have mistaken.
Thanks,
Serpent Consulting Services.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 70 lines (+6/-40)1 file modifiedreport_webkit/webkit_report.py (+6/-40)
Changed in openobject-addons: | |
assignee: | nobody → Nicolas Bessi - Camptocamp (nbessi-c2c) |
Changed in openobject-addons: | |
status: | Confirmed → Fix Released |
IMHO the problem comes from another issue
the translation for webkit reports stores the the terms with
name = report_file
instead
name = report_name in ir_translation
whereas the runtime translation routine searches for report_name to find the translation - which IMHO is correct.
after running
update ir_translation set name ='report. account. invoice. webkit' where name = 'account_ invoice_ webkit/ report/ account_ invoice_ webkit. mako';
the translations works