summaryrefslogtreecommitdiff
path: root/addons/document/static/src/js/document.js
diff options
context:
space:
mode:
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);
},
//--------------------------------------------------------------------------