From 1da79b872e7b90b67a097ed50b974c879f26bea2 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 14 Sep 2016 14:33:50 +0200 Subject: [FIX] web: keep m2m value in list view Currently, when rendering a list view cell with a many2many we would empty the list of ids, and fill it again once a name_get is resolved. But in some instance, the code could use the data when it has been emptied out. For example, if we set the tax_id field (inside the order_line list view inside the sale.order form view) as requred, if we modify the order line and save directly (without clicking outside of the list view) we can get an incorrect error saying that the "Order Line" is not valid. It has been reproduced when saving with CTRL + SHIFT + S on google chrome and firefox, and there have been reports that for some configuration it also happen when clicking on the "Save" button. This commit change the behaviour so the value is kept whilst the name_get is ongoing, and just use a default "false" value for the name during this interval. closes #13478 opw-668067 --- addons/web/static/src/js/view_list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index c460cc598f0..9fe5426f2cc 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1125,8 +1125,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. _(names).pluck(1).join(', ')); record.set(column.id, ids); }); - // temp empty value - record.set(column.id, false); + // temporary empty display name + record.set(column.id + '__display', false); } } return column.format(record.toForm().data, { -- cgit v1.2.3 From a2946f72d9e0e26d6e10e9bab8e1d3a09e270e6b Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 15 Sep 2016 11:44:37 +0200 Subject: [FIX] web: error when click twice on "Salary Structures Hierarchy" --- addons/web/static/src/js/views/tree_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/tree_view.js b/addons/web/static/src/js/views/tree_view.js index aeb206257fe..604c9204b42 100644 --- a/addons/web/static/src/js/views/tree_view.js +++ b/addons/web/static/src/js/views/tree_view.js @@ -49,7 +49,7 @@ var TreeView = View.extend({ }, willStart: function () { _(this.fields_view.arch.children).each(function (field) { - if (field.attrs.modifiers) { + if (field.attrs.modifiers && typeof field.attrs.modifiers === "string") { field.attrs.modifiers = JSON.parse(field.attrs.modifiers); } }); -- cgit v1.2.3