在现有模块中创建新报表(openerp7)

2024-05-12 14:41:15 发布

您现在位置:Python中文网/ 问答频道 /正文

为了添加一个新报表,以便从employee视图打印它,我用Libreoffice:opennew report创建了一个.sxw文件-->;我选择了employee-->;add a loop-->;我将它发送到服务器enter image description here,然后将它导出到.rml。 我的问题是:如果我不发送我的报告到服务器,我将无法找到它,当我点击打印或当我安装在另一台机器我的模块。。。xml文件包含: 来自时间表/报告/证明的人力资源工资单_阵痛.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>

你知道吗 来自时间表/报告的人力资源薪资/认证.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')

从时间表/报表/初始化.py获得的人力资源工资:

import attestation

人力资源工资表/开放式你知道吗

'data': [
      'report/attestation_travail.xml',
],

谢谢你的帮助,致以最诚挚的问候


Tags: fromgtreport报告employeehrxmltimesheet
1条回答
网友
1楼 · 发布于 2024-05-12 14:41:15

@ParaMeterz在这个链接中回答了一个类似的问题: OpenERP - Report Creation

我建议遵循链接并验证您的.xml文件,请尝试以下操作:

 <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>

另外,在保存.sxw文件时,不要只将report_name.sxw放在libreoffice中,您必须选择.sxw格式。你知道吗

相关问题 更多 >