no se puede hacer clic en el botón odoo

En un requisito, un botón debe tener un estado en el que no se pueda hacer clic,
similar al siguiente efecto. Los
Inserte la descripción de la imagen aquí
tres botones no se pueden hacer clic, solo para indicar ciertas situaciones. El
código es el siguiente:

 <button string="技术通过" name="action_none" class="oe_highlight"
         type="object" style="background-color: #e7e7e7; color: black;pointer-events: none;" attrs="{
     
     'invisible': [('technical_pass','=', False),('state', '!=', 'reviewed')]}"/>
<button string="生产通过" name="action_none" class="oe_highlight"
        type="object" style="background-color: #e7e7e7; color: black;pointer-events: none;" attrs="{
     
     'invisible': [('production_pass','=', False),('state', '!=', 'reviewed')]}"/>
<button string="质检通过" name="action_none" class="oe_highlight"
        type="object" style="background-color: #e7e7e7; color: black;pointer-events: none;" attrs="{
     
     'invisible': [('quality_pass','=', False),('state', '!=', 'reviewed')]}"/>

    def action_none(self):
        """按钮必须执行方法,不然报错,写次方法"""
        return None

Principalmente en el botón que agregó style = "pointer-events: none ;", CSS no hace clic, Style es
style = "background-color: # e7e7e7; color: black; pointer-events: none;"
por lo que hay momentos por encima del estilo y función de

Supongo que te gusta

Origin blog.csdn.net/weixin_42464956/article/details/110244905
Recomendado
Clasificación