我尝试在自定义模块中更改报表定义,但我没有成功。
这是报告:
<report
id="account_invoices"
model="account.invoice"
string="Invoices"
report_type="qweb-pdf"
name="account.report_invoice"
file="account.report_invoice"
attachment_use="True"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
/>
我要删除attachment_use属性然后设置
<report
id="account_invoices"
model="account.invoice"
string="Invoices"
report_type="qweb-pdf"
name="account.report_invoice"
file="account.report_invoice"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
/>
但它不是替换报告,而是创建一个新报告。 有没有办法改变这个值?
感谢
答案 0 :(得分:1)
是的,只需在ID中添加帐户前缀即可。如下所示。这是模块的名称,其中报告实际存在。这不会创建新报告并在现有报告中进行更改。
<report
id="account.account_invoices"
model="account.invoice"
string="Invoices"
report_type="qweb-pdf"
name="account.report_invoice"
file="account.report_invoice"
attachment_use="False"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
/>