diff options
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 | 10 |
1 files changed, 4 insertions, 6 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 8a9b3713f15..b4d00b6bb76 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -314,7 +314,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * * @private */ - _disableButtons: function () { + _disableButtons: function () { if (this.$buttons) { this.$buttons.find('button').attr('disabled', true); } @@ -346,10 +346,8 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { return; } self.model.discardChanges(recordID); - if (self.model.isNew(recordID)) { - if (self.model.canBeAbandoned(recordID)) { - self._abandonRecord(recordID); - } + if (self.model.canBeAbandoned(recordID)) { + self._abandonRecord(recordID); return; } return self._confirmSave(recordID); @@ -360,7 +358,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * * @private */ - _enableButtons: function () { + _enableButtons: function () { if (this.$buttons) { this.$buttons.find('button').removeAttr('disabled'); } |
