openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #01687
[Bug 893474] Re: Translations not working after overwrite a report
** Changed in: openobject-addons
Importance: Undecided => Low
** Changed in: openobject-addons
Status: New => Confirmed
** Changed in: openobject-addons
Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)
** Project changed: openobject-addons => openobject-server
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/893474
Title:
Translations not working after overwrite a report
Status in OpenERP Server:
Confirmed
Bug description:
After overwriting an existing report, the translation will not work.
For example, I need to rewrite the template of payslip.pdf, the
following definition works well:
<report auto="False" id="hr_payroll.salary_payslip" model="hr.payslip"
name="payslip.pdf" rml="mymodule/report/payslip.rml" string="Employee PaySlip" />
But there is also a method has to be override in payslip_report class,
so I create a new class to extend it like this:
from datetime import datetime
from hr_payroll.report.report_payslip import payslip_report
class payslip_report(payslip_report):
def get_month(self, obj):
return datetime.strptime(obj.date, '%Y-%m-%d').strftime('%Y-%m')
As we know, to make it effect, we must register it with report_sxw:
report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip',
'mymodule/report/payslip.rml', parser=payslip_report)
This brings the error: The report "report.payslip.pdf" already exists!
Then I change both report definition and register name to
'report.my.payslip.pdf', but the translation never works.
Look into report relative classes, I realize the name is used for
searching translation table in report_sxw._translate method.
Any solution?
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/893474/+subscriptions
References