From e1cde4d0383124c0636c518185f2222055afa3b5 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 10 Dec 2014 21:35:49 +0100 Subject: [PATCH] [FIX] web: 558efaceadf027a51a049c2df4c570ec590353ac not working for modals. The above revision, which was already a patch for rev. a8f94a59cde1c4034b1a704014d1572598db833f, did not work properly for modals, like the use template many2one field of the mail.compose.message wizard. We therefore append the ui-menu selection nearer to the input field. $el.parent().parent() looks odd, but the goal is to append this selection ui just after the parent of the field, but as jquery ui autocomplete only accepts appendTo (and not after()), we append it to the parent of the field parent. This fix has been verified for * many2one fields in classic form view (with or without sheets) * many2one fields in editable list view (embedded in form view or not- * many2one fields in wizard modals * many2one fields of the bank statement reconciliation widget --- addons/web/static/src/js/view_form.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 2c3b952d2ee..13141d8d5d4 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3736,10 +3736,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc minLength: 0, delay: 250, }); - var appendTo = this.$input.parents('.oe_view_manager_body'); - if (appendTo.length === 0){ - appendTo = self.view.ViewManager.$el; - } + var appendTo = this.$el.parent().parent(); this.$input.autocomplete({ appendTo: appendTo });