summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-12-22 14:41:27 +0000
committerAaron Bohy <aab@odoo.com>2021-01-04 14:15:22 +0000
commit7d04ec7cca4f355295a06c1ce6f112b6cc533c87 (patch)
treeef347de78a8574a4fe25a43d67fc94d036949eb2 /addons/web/static/src/js/views
parent592ee14d7fe81e7e5afd23f2bbbdac344eae6060 (diff)
[FIX] web: editable list: do not discard row on m2o blur
Let's assume an editable list with a many2one field. The user types something in the many2one and then clicks outside (mousedown, not mouseup, and thus click, yet). A dialog opens to ask the user if he wants to quickcreate a record. Before this commit, the dialog and the row disappeared as soon as he released the click, because the click was considered by the list renderer as an "external click", and the row was discarded (alongside the many2one it contained). Task 2411029 closes odoo/odoo#63697 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views')
-rw-r--r--addons/web/static/src/js/views/list/list_editable_renderer.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js
index 99bbcfbb814..2cfe3191a99 100644
--- a/addons/web/static/src/js/views/list/list_editable_renderer.js
+++ b/addons/web/static/src/js/views/list/list_editable_renderer.js
@@ -1815,12 +1815,12 @@ ListRenderer.include({
return;
}
- // ignore clicks in modals, except if the list is in a modal, and the
- // click is performed in that modal
- var $clickModal = $(event.target).closest('.modal');
- if ($clickModal.length) {
+ // ignore clicks if there is a modal, except if the list is in the last
+ // (active) modal
+ var $modal = $('.modal:last');
+ if ($modal.length) {
var $listModal = this.$el.closest('.modal');
- if ($clickModal.prop('id') !== $listModal.prop('id')) {
+ if ($modal.prop('id') !== $listModal.prop('id')) {
return;
}
}