[FIX] survey: add support for 'disabled' attribute on buttons (in views)
In the xml file of the list view, it is possible to define a button that will be placed in a new column. When the user clicks on a button from a list view, the script will execute the action linked to the corresponding button. Unfortunately, all the buttons of the list views are not necessary linked to an action: This is for example the case for the trophy icon of the survey module. An exception can hence be thrown if the user clicks on such button. To solve the issue, we will add the 'disabled' property support for the buttons and we will add that property to the buttons that do not have an action. With this property, the script will bind no listener to the button and it will hence not call the listener causing the error. task-2612033 closes odoo/odoo#75096 X-original-commit: c698d589e7dfa6fe3df8b4014fe30627693e9043 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
committed by
Thibault Delavallée
parent
c9534d2512
commit
b6974528f9
@@ -173,7 +173,9 @@
|
||||
<field name="success_count"/>
|
||||
<field name="success_ratio"/>
|
||||
<field name="answer_score_avg"/>
|
||||
<button name="certification" icon="fa-trophy" title="Certification" aria-label="Certification" attrs="{'invisible': [('certification', '=', False)]}"/>
|
||||
<button name="certification" type="button" disabled="disabled"
|
||||
icon="fa-trophy" title="Certification" aria-label="Certification"
|
||||
attrs="{'invisible': [('certification', '=', False)]}"/>
|
||||
<!-- Tweak as icons aren't directly supported in xml -->
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -340,6 +340,7 @@
|
||||
<rng:ref name="modifiable"/>
|
||||
<rng:optional><rng:attribute name="attrs"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="invisible"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="disabled"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="name" /></rng:optional>
|
||||
<rng:optional><rng:attribute name="icon" /></rng:optional>
|
||||
<rng:optional><rng:attribute name="string" /></rng:optional>
|
||||
|
||||
Reference in New Issue
Block a user