diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-06-09 17:11:47 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-06-09 17:11:47 +0200 |
| commit | ab02bf34b0c1d3fa3752ca1f50b098d04dc5b137 (patch) | |
| tree | a29591cae8777390cbeb35d65e23c9f8ae143135 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | b350c29e44b4ed1df0c428308c396771b22d73e8 (diff) | |
| parent | cc38b93ab2a6daf9c5badbc387cff20d1a01ddee (diff) | |
[MERGE] forward port branch saas-16 up to cc38b93ab2a
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_controller.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index 53e5be8ff6e..16a066db495 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -46,6 +46,9 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * @returns {Deferred} */ start: function () { + // add classname to reflect the (absence of) access rights (used to + // correctly display the nocontent helper) + this.$el.toggleClass('o_cannot_create', !this.activeActions.create); return this._super.apply(this, arguments) .then(this._updateEnv.bind(this)); }, @@ -186,8 +189,12 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { // user if some discarding has to be made). This operation must also be // mutex-protected as commitChanges function of x2m has to be aware of // all final changes made to a row. - this.mutex.exec(this.renderer.commitChanges.bind(this.renderer, recordID || this.handle)); // TODO write a test for this - return this.mutex.exec(this._saveRecord.bind(this, recordID, options)); + var self = this; + return this.mutex + .exec(this.renderer.commitChanges.bind(this.renderer, recordID || this.handle)) + .then(function () { + return self.mutex.exec(self._saveRecord.bind(self, recordID, options)); + }); }, /** * @override |
