1

我尝试制作报告,仅当其类型为“in_invoice”时才打印发票

我使用标准情况

<report
    id="account_att"
    model="account.invoice"
    string="Att"
    report_type="qweb-pdf"
    name="account.report_att"
    attachment="('Att'+(object.number or '').replace('/','')+'.pdf')"
    print_report_name="'Att for '+(object._get_printed_report_name())"
/>

如何检查对象类型是否为“in_invoice”?我试图添加

menu="(True if object.type == 'in_invoice' else False)"

但是我在安装时遇到错误 - 似乎菜单没有收到对象。

如何更改可见性?

4

0 回答 0