1

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 enter image description here, 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

imad
  • 179
  • 13

1 Answers1

1

As @ParaMeterz replied to a similaire question in this link: OpenERP - Report Creation

I suggest to follow the link and also verify your .xml file, try this one:

 <openerp>
  <data>

   <report id="report_attestation_travail"
           string="attestation de travail"
           model="hr.employee"
           name="hr_payroll_from_timesheet.attestation_travail"
           rml="hr_payroll_from_timesheet/report/attestation_travail.rml"
           auto="False"/>

 </data>

Also when you save your .sxw file, don't just put report_name.sxw you have to choose .sxw format in libreoffice.

user3676872
  • 204
  • 1
  • 12