From 0b2fd60041f746f083f44afe5b6ba2c0b95ba1ee Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 3 Apr 2017 11:45:59 +0200 Subject: [PATCH] [FIX] web: editable list view regression bc031379 (9.0) In 9.0 in some particular instances with embedded views, if: - an x2many list view is editable, - we go from a form view of an existing record to creating a record, - the timings of deferred resolving are in a certain order the x2many list view could be tought as loaded whilst in reality it is the 'editable list view' row editing 'form view' that has been loaded. This could cause sometimes issues after bc031379 because the onchange computation would happen before the list view is really loaded. This is probably an issue with the deferred system in one of the views, but it would be rather hard and dangerous to change it. So this fix introduce an additional test which ignore relational views if there is an embedded view. opw-726701 opw-726768 note: only needed for 9.0, the relational views have been changed as of saas-11 and this issue is not present. --- addons/web/static/src/js/views/form_view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/form_view.js b/addons/web/static/src/js/views/form_view.js index 2aa3f4874f5..faa9bae26cd 100644 --- a/addons/web/static/src/js/views/form_view.js +++ b/addons/web/static/src/js/views/form_view.js @@ -485,7 +485,8 @@ var FormView = View.extend(common.FieldManagerMixin, { if (field.viewmanager) { _.each(field.viewmanager.views, function(view, view_type) { // add default view if it was not embedded and it is loaded - if (views[view_type] === undefined && view.controller) { + var not_embedded = view.embedded_view === undefined; // ONLY FOR 9.0 + if (views[view_type] === undefined && view.controller && not_embedded) { views[view_type] = view.controller.fields_view; } });