From 10cb74557530a2325adf1b8c8859ef87a1d9c4f4 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 21 Sep 2018 11:25:52 +0200 Subject: [PATCH] [FIX] document: updateEnv->redraw on not form view In ac1e187ee some unecessary code and RPC were removed by ignoring attachments in the sidebar when they would never be shown. But there was an regression since `updateEnv` function would not longer call redraw (which is also called in _super function). report: https://github.com/odoo/odoo/commit/ac1e187eea3#r30569171 related to opw-1865736 closes #27146 --- addons/document/static/src/js/document.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index 98bfe4e5ef333..5c33a3f3cff82 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -50,10 +50,9 @@ Sidebar.include({ * @override */ updateEnv: function (env) { - if (this.hasAttachments) { - this.env = env; - this._updateAttachments().then(this._redraw.bind(this)); - } + var _super = _.bind(this._super, this, env); + var def = this.hasAttachments ? this._updateAttachments() : $.when(); + def.then(_super); }, //--------------------------------------------------------------------------