summaryrefslogtreecommitdiff
path: root/addons/document/static/src/js/document.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-09-21 09:25:52 +0000
committerNicolas Lempereur <nle@odoo.com>2018-09-21 11:08:11 +0000
commitb3a3ad80991265c50f38fd20588df9a69b6bcf67 (patch)
tree56c5ff43aab8a37934205e3bb9bb1bbb0b44f0f3 /addons/document/static/src/js/document.js
parenta1501c3e58b1e92cf52bb4b654839de7b5a56c12 (diff)
[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
Diffstat (limited to 'addons/document/static/src/js/document.js')
-rw-r--r--addons/document/static/src/js/document.js7
1 files changed, 3 insertions, 4 deletions
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);
},
//--------------------------------------------------------------------------