我可以从OpenERP的标准报告中继承吗? [英] Can I inherit from a standard report in OpenERP?

查看:59
本文介绍了我可以从OpenERP的标准报告中继承吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在OpenERP 6.1中更改采购订单报告.我必须进入并更改购买模块,还是可以创建一个将继承标准报告并覆盖一些详细信息的新模块.

解决方案

您不能完全继承另一个报表,而只是覆盖一些详细信息,但是可以替换一个标准报表,并使其所有现有链接启动您的新报表.

我们的 zaber_purchase 模块包含用户想要的对采购订单报告的一些更改.这是 purchase_report.xml 替换标准报告的文件和我们一起.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report 
            auto="False" 
            id="purchase.report_purchase_order" 
            model="purchase.order" 
            name="purchase.order.zaber"
            rml="zaber_purchase/report/order.rml" 
            string="Purchase Order"
            usage="default"/>
    </data>
</openerp>

由于它不是继承而是替换报告,因此必须在您的版本中复制整个报告.您的报告ID必须与原始报告ID(包括模块名称)匹配.在上面的示例中,原始报告的ID为report_purchase_order,并且它是purchase模块的一部分,因此您的报告ID必须为purchase.report_purchase_order才能替换它.名称必须与您版本的解析文件,并且rml属性必须指向您版本的 mihai 在OpenERP论坛中解释了其中的大部分内容. /p>

I want to make changes to the purchase order report in OpenERP 6.1. Do I have to go in and make changes to the purchase module, or can I create a new module that will inherit the standard report and override some details.

解决方案

You can't exactly inherit another report and just override some details, but you can replace a standard report and make all existing links to it launch your new report instead.

Our zaber_purchase module contains some changes to the purchase order report that our users wanted. Here's the purchase_report.xml file that replaces the standard report with ours.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report 
            auto="False" 
            id="purchase.report_purchase_order" 
            model="purchase.order" 
            name="purchase.order.zaber"
            rml="zaber_purchase/report/order.rml" 
            string="Purchase Order"
            usage="default"/>
    </data>
</openerp>

Since it's not inheriting but replacing the report, you have to duplicate the whole report in your version. Your report's id has to match the original report's id, including the module name. In the example above, the original report has an id of report_purchase_order, and it's part of the purchase module, so your report id must be purchase.report_purchase_order to replace it. The name has to match the name in your version's parser file, and the rml attribute has to point to your version's RML file.

Thanks to mihai for explaining most of this in the OpenERP forum.

这篇关于我可以从OpenERP的标准报告中继承吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆