我自定义销售模块,因为我隐藏了销售订单FORM VIEW中的一些字段。当我去打印发票时,会显示一些空的字段,这些字段是我在表单视图中已经隐藏的字段。如何隐藏openerp中某些模块的qweb报告中的字段?
所以我想让这些字段也隐藏在报告中。这样做的方法是什么,任何想法?
Reference:
Sales/Quotations/ print : sale.report_saleorder.pdf
因此,我想隐藏Taxes字段。
我自定义销售模块,因为我隐藏了销售订单FORM VIEW中的一些字段。当我去打印发票时,会显示一些空的字段,这些字段是我在表单视图中已经隐藏的字段。如何隐藏openerp中某些模块的qweb报告中的字段?
所以我想让这些字段也隐藏在报告中。这样做的方法是什么,任何想法?
Reference:
Sales/Quotations/ print : sale.report_saleorder.pdf
因此,我想隐藏Taxes字段。
您可以在报告中几乎像在表单视图中一样隐藏所需的那些字段。在视图文件夹中创建一个XML文件并将其添加到__openerp__.py
。启动文件是这样的:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_saleorder_document_customized" inherit_id="sale.report_saleorder_document">
...
从这里开始,你必须使用xpath
标记来定位你的项目,并(使用position="attributes"/"replace"
)使他们在你一个简单的表格视图做同样的方式无形。
问候。
您可以使用下面的代码隐藏qweb报告中的某个部分。
在这里,我想隐藏税表和更改的字符串值,并隐藏Inovice报表的付款期限。
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_invoice_document_inherit" inherit_id="account.report_invoice_documnet">
<!-- Changed 'Draft Invoice' to 'Tax Invoice' and 'Invoice' to 'Tax Invoice'-->
<xpath expr="//div[@class='page']/h2/span[1]" position="replace">
<span t-if="o.type == 'out_invoice' and (o.state in ('draft', 'open', 'paid'))">Tax Invoice</span>
</xpath>
<!-- Hide span -->
<xpath expr="//div[@class='page']/h2/span[3]" position="replace"/>
<!--Hide Tax table -->
<xpath expr="//div[@class='page']/div[4]" position="attributes">
<attribute name="class">hidden</attribute>
</xpath>
<!-- Hide payment term value from invoice report -->
<xpath expr="//div[@class='page']/p[2]" position="attributes">
<attribute name="class">hidden</attribute>
</xpath>
</template>
</data>
</odoo>
希望以上代码可以帮助您。
最好的感谢,
ANKIT^h甘地。