In order to add a new report so I can print it from employee view, I've created an .sxw
file with Libreoffice: open new report --> I've choosed employee --> add a loop -->I sent it to server , then exported it to
.rml
.
My problem is: if I don't send my report to server i won't be able to find it when I click on print or when i install my module in another machine... xml file contains:
hr_payroll_from_timesheet/report/attestation_travail.xml
<openerp>
<data>
<report id="report_attestation_travail"
string="attestation de travail"
model="hr.employee"
name="report.hr_payroll_from_timesheet.attestation_travail"
rml="hr_payroll_from_timesheet/report/attestation_travail.rml"
auto="False"
menu="False"/>
</data>
hr_payroll_from_timesheet/report/attestation.py :
import time
from openerp.report import report_sxw
class attestation(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
super(attestation, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
})
report_sxw.report_sxw('report.hr_payroll_from_timesheet.attestation_travail', 'hr.employee', 'addons/hr_payroll_from_timesheet/report/attestation_travail.rml', parser=attestation, header='internal')
hr_payroll_from_timesheet/report/init.py :
import attestation
hr_payroll_from_timesheet/openerp.py
'data': [
'report/attestation_travail.xml',
],
thank you for your help, best regards