Skip to content
Snippets Groups Projects
Commit 0f177045 authored by Julien Banken's avatar Julien Banken
Browse files

[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#74348

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 609abfa3
Branches
Tags
No related merge requests found
......@@ -137,7 +137,7 @@
<field name="success_count"/>
<field name="success_ratio"/>
<field name="answer_score_avg"/>
<button name="certificate" icon="fa-trophy" title="Certificate" aria-label="Certificate" attrs="{'invisible': [('certificate', '=', False)]}"/>
<button name="certificate" type="button" disabled="disabled" icon="fa-trophy" title="Certificate" aria-label="Certificate" attrs="{'invisible': [('certificate', '=', False)]}"/>
<!-- Tweak as icons aren't directly supported in xml -->
</tree>
</field>
......
......@@ -326,6 +326,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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment