如果命令行中有任务/服务,我想根据条件隐藏“创建发票”按钮(在报价视图中),我尝试了此代码,但没有用:
<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')]}"/>
答案 0 :(得分:0)
您可以将样式bison -Dapi.prefix=GENLIB_yy
添加到按钮中以将其隐藏
答案 1 :(得分:0)
您可以编写如下所示的按钮:
<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')]}"/>