首页 > 解决方案 > Hide button based on checkbox in odoo 12

问题描述


I want to hide action_invoice_button based on checkbox,
if my checkbox is true button should be shown else it should be hidden. here is my code.

<xpath expr="//button[@name='action_invoice_open']" position="attributes">
    <attribute name="attrs">{'invisible': [('doc_ready', '=', 'False')]}</attribute>
</xpath>

but this did not work.

标签: python-3.xodoo-12

解决方案


米兰瓦拉

有时我们忘记检查一个小错误。

代码:

<xpath expr="//button[@name='action_invoice_open']" position="attributes">
    <attribute name="attrs">{'invisible': [('doc_ready', '=', False)]} </attribute>
</xpath>

推荐阅读