En un requisito, un botón debe tener un estado en el que no se pueda hacer clic,
similar al siguiente efecto. Los
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