credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #00241
[Bug 897412] [NEW] webkit_report : setLang() doesn't work!
Public bug reported:
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:
ob._context['lang'] = ob.lang
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.
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/897412
Title:
webkit_report : setLang() doesn't work!
Status in OpenERP Addons (modules):
New
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:
ob._context['lang'] = ob.lang
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/897412/+subscriptions
Follow ups
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Allen Wyma, 2012-02-01
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Nicolas Bessi - Camptocamp, 2012-01-24
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Jean-Marc Vandel, 2012-01-24
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Nicolas Bessi - Camptocamp, 2012-01-17
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Nicolas Bessi - Camptocamp, 2012-01-16
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Nicolas Bessi - Camptocamp, 2012-01-10
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Ferdinand @ Camptocamp, 2011-12-30
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Ferdinand @ Camptocamp, 2011-12-30
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Amit Parik (OpenERP), 2011-11-29
-
[Bug 897412] Re: webkit_report : setLang() doesn't work!
From: Serpent Consulting Services, 2011-11-28
-
[Bug 897412] [NEW] webkit_report : setLang() doesn't work!
From: Serpent Consulting Services, 2011-11-28
References