如何根据条件隐藏按钮? odoo 11 [英] how to hide the button based on a condition? odoo 11

查看:841
本文介绍了如何根据条件隐藏按钮? odoo 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果命令行中有任务/服务,我想根据条件隐藏创建发票"按钮(在报价视图中),我尝试了此代码,但没有用:

I want to hide the "create invoice" button (in quotation view) based on a condition if the command line has a task/service, I tried this code but it does not work :

<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
                    type="action" context="{'default_advance_payment_method': 'percentage'}"
                    attrs="{'invisible': ['|','|', ('task_ids', '=', []), ('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>

推荐答案

您可以编写如下所示的按钮:

You can write a button like the following:

  <button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
                type="action" context="{'default_advance_payment_method': 'percentage'}"
                attrs="{'invisible': ['|','|', ('task_ids', '=', False), ('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>  

这篇关于如何根据条件隐藏按钮? odoo 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆