python-3.x - 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.
解决方案
米兰瓦拉
有时我们忘记检查一个小错误。
代码:
<xpath expr="//button[@name='action_invoice_open']" position="attributes">
<attribute name="attrs">{'invisible': [('doc_ready', '=', False)]} </attribute>
</xpath>
推荐阅读
- swift - 阿拉伯语应用程序的英文字母顺序相反(在 wkwebview 内)
- laravel - Laravel 向新注册用户发送电子邮件
- c# - 处理程序多次触发同一通知,但自动接线按预期工作
- javascript - Laravel & JQuery : 获取可拖放图像中可拖动对象的正确位置
- python - 有没有办法可以将 2 个列表和一个数组组合成一个多字典?
- kubernetes - 如何设置 KUBECONFIG 从 github 操作部署连接到 Azure Kubernetes 服务?
- python - Python3 - 从多个文件计算并保存到新文件
- python - Python二进制和常规字符串混淆
- flutter - Flutter:FormBuilderDropdown 自动完成
- reactjs - 我可以让我的 React 项目完全离线工作吗?