From dcde0aaf30fa52f59341edb274bab02e8e9aea88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 26 May 2017 11:36:00 +0200 Subject: [FIX] web: recompute decoration classnames when necesssary Before this commit, row decorations were only computed at the initial rendering for a list view, then never recomputed. Most of the time, it is not an issue, but list view can be edited, and in that case, it may be a problem. With this commit, we just override the confirmChange method to recompute the various decorations. Note that in bonus, decorations now works in realtime, when editing a list view (in saas-15, they simply did not work when editing a record) Also, we now use the same evaluation context as everything else in the web client: the eval context from the record, not some custom handmade context like before. --- addons/web/static/src/js/views/basic/basic_renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js') diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 2e36a4cac55..8bbf9ae45a4 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -91,7 +91,7 @@ var BasicRenderer = AbstractRenderer.extend({ var record = state.id === id ? state : _.findWhere(state.data, {id: id}); if (!record) { - return this._render(); + return this._render().then(_.constant([])); } var defs = []; -- cgit v1.2.3