From b3a3ad80991265c50f38fd20588df9a69b6bcf67 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 21 Sep 2018 09:25:52 +0000 Subject: [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(-) (limited to 'addons/document') diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index 98bfe4e5ef3..5c33a3f3cff 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); }, //-------------------------------------------------------------------------- -- cgit v1.2.3