summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2019-04-29 15:15:35 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2019-05-06 15:33:48 +0000
commitddb8fc1f628433e40ae3196115f7b9a11e5b5254 (patch)
tree0fee4d756eee14b3ac284823476d2acc25085c7c /addons/web/static/src/xml/base.xml
parent1d7a544d95911addd8e898cd78a9373f43fd84be (diff)
[FIX] web: checkbox in favorites menu: don't close on click
Following f4fbaf1efae11e8bd3b1a2938ab765d391764a1b which changes the label/checkbox structure into: ``` <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="customCheck1"> <label class="custom-control-label" for="customCheck1">...</label> </div> ``` So, before this commit, there may have been multiple input with the same Id. The consequence is that, when clicking on a label, the browser would take the first Id it found which was erroneous, because all checkboxes in Favorites menu had the same Id In reality, the use case goes as: - open a x2m, - search more - Favorites > Save current search > click on one the two checkboxes > The dropdown closed, without checking the box After this commit, when clicking on the checkbox in the favorites menu the checkbox is toggled and the dropdown stays. Also, the checkboxed have now unique ids OPW 1974587 closes odoo/odoo#33032 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
-rw-r--r--addons/web/static/src/xml/base.xml9
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 223a7b7785c..f286e81e597 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1359,16 +1359,17 @@
<div role="menuitem" class="dropdown-item-text o_save_name">
<input type="text" class="o_input"></input>
</div>
+ <t t-set="favId" t-value="_.uniqueId('_checkbox_')" />
<div role="menuitem" class="dropdown-item-text o_save_name">
<div class="custom-control custom-checkbox">
- <input type="checkbox" id="o_fav_menu_use_by_default" class="custom-control-input"/>
- <label for="o_fav_menu_use_by_default" class="custom-control-label">Use by default</label>
+ <input type="checkbox" t-attf-id="o_fav_menu_use_by_default#{favId}" class="custom-control-input"/>
+ <label t-attf-for="o_fav_menu_use_by_default#{favId}" class="custom-control-label">Use by default</label>
</div>
</div>
<div role="menuitem" class="dropdown-item-text o_save_name">
<div class="custom-control custom-checkbox">
- <input type="checkbox" id="o_fav_menu_share_all_users" class="custom-control-input"/>
- <label for="o_fav_menu_share_all_users" class="custom-control-label">Share with all users <span class="fa fa-users" role="img" aria-label="Users" title="Users"/></label>
+ <input type="checkbox" t-attf-id="o_fav_menu_share_all_users#{favId}" class="custom-control-input"/>
+ <label t-attf-for="o_fav_menu_share_all_users#{favId}" class="custom-control-label">Share with all users <span class="fa fa-users" role="img" aria-label="Users" title="Users"/></label>
</div>
</div>
<div class="dropdown-item-text o_save_name">