From 7dc3662ec5bc185890d3858107f13b5f3c85af57 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 21 Feb 2017 12:51:09 +0100 Subject: [PATCH 1/4] [FIX][web_m2x_options] Fix Qweb templates. They were trying to replace non-existing elements, and this was being logged to console: Can't find "a.oe_m2o_cm_button" when extending template FieldMany2One Can't find "span.badge" when extending template FieldMany2ManyTag --- web_m2x_options/README.rst | 3 ++- web_m2x_options/__openerp__.py | 5 +++-- web_m2x_options/static/src/xml/base.xml | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst index dff75f05fe73..98cefc3c2dc6 100644 --- a/web_m2x_options/README.rst +++ b/web_m2x_options/README.rst @@ -116,7 +116,7 @@ Your XML form view definition could contain:: Known issues ============ -Double check that you have no inherited view that remove ``options`` you set on a field ! +Double check that you have no inherited view that remove ``options`` you set on a field ! If nothing works, add a debugger in the first line of ``get_search_result method`` and enable debug mode in Odoo. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. Roadmap @@ -146,6 +146,7 @@ Contributors * Nicolas JEUDY * Yannick Vaucher * Zakaria Makrelouf +* Jairo Llopis Maintainer ---------- diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index 94c1a525bd55..99d4b33a5a8c 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "9.0.1.0.0", + "version": "9.0.1.0.1", "depends": [ 'base', 'web', @@ -12,6 +12,7 @@ ], 'license': 'AGPL-3', 'data': ['views/view.xml'], - "author": "ACSONE SA/NV, 0k.io,Odoo Community Association (OCA)", + "author": "ACSONE SA/NV, 0k.io, Tecnativa, " + "Odoo Community Association (OCA)", 'installable': True, } diff --git a/web_m2x_options/static/src/xml/base.xml b/web_m2x_options/static/src/xml/base.xml index 8b9421d190ac..4d26ba92dd03 100644 --- a/web_m2x_options/static/src/xml/base.xml +++ b/web_m2x_options/static/src/xml/base.xml @@ -1,13 +1,16 @@ + + - - - jQuery(this).attr('t-if', '!(widget.options.no_open || widget.options.no_open_edit)'); + + + !(widget.options.no_open || widget.options.no_open_edit) + - - - - jQuery(this).attr('t-att-data-id', 'el[0]'); + + + el[0] + - From 0dc5db9173086f4c5759dce4a0e786824b250c52 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 24 Feb 2017 12:10:20 +0100 Subject: [PATCH 2/4] Raise version correctly. --- web_m2x_options/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index 99d4b33a5a8c..7206c3ca0331 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "9.0.1.0.1", + "version": "9.0.1.1.0", "depends": [ 'base', 'web', From f34a3e0fc8aacbe5a3f91570bfb81cd549d4fce3 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 3 Mar 2017 11:46:56 +0100 Subject: [PATCH 3/4] [FIX] Make many2many_tags tag deletion work again --- web_m2x_options/static/src/xml/base.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/web_m2x_options/static/src/xml/base.xml b/web_m2x_options/static/src/xml/base.xml index 4d26ba92dd03..094e942eada0 100644 --- a/web_m2x_options/static/src/xml/base.xml +++ b/web_m2x_options/static/src/xml/base.xml @@ -8,9 +8,4 @@ !(widget.options.no_open || widget.options.no_open_edit) - - - el[0] - - From 86f5fc8296cb1fcc77bcd58e37febd611552e5e6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 3 Mar 2017 12:21:24 +0100 Subject: [PATCH 4/4] Correct replacement of event Instead of overwriting all events from upstream widget, better just overwrite the one you need and inherit the rest. --- web_m2x_options/static/src/js/form.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 4b8d0ad13eea..4fb83da338e9 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -260,13 +260,9 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { }); form_relational.FieldMany2ManyTags.include({ - events: { - 'click .o_delete': function(e) { - this.remove_id($(e.target).parent().data('id')); - }, - 'click .badge': 'open_badge', - 'mousedown .o_colorpicker span': 'update_color', - 'focusout .o_colorpicker': 'close_color_picker', + init: function () { + this.events["click .badge"] = "open_badge"; + return this._super.apply(this, arguments); }, show_error_displayer: function () { if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) ||