friend 们大家好,我在 odoo 中有一个按钮,当满足 3 个条件时我希望它不可见:
<button class="oe_highlight" name="formview" type="object" string="Pagar" attrs="{'invisible':['|',('status_inv', '=',2),('validate_cheque', '=',False),('pay', '=',True)]}"/>
我以这种方式拥有不可见属性,但它的表现不佳。
如果我更换它| by & odoo 给出了一个错误,最后我想要的是,如果满足 3,它的行为就像 AND 运算符,这是不可见的
最佳答案
试试这个:
<button class="oe_highlight" name="formview" type="object" string="Pagar" attrs="{'invisible':[('status_inv', '=',2),('validate_cheque', '=',False),('pay', '=',True)]}"/>
如果没有声明运算符,则默认使用“&”运算符。
关于python - attrs odoo 10 中的不规则之处,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51883840/