summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
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.js10
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 516d3b0a337..98ba1e927e1 100644
--- a/addons/web/static/src/js/views/basic/basic_controller.js
+++ b/addons/web/static/src/js/views/basic/basic_controller.js
@@ -309,7 +309,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
*
* @private
*/
- _disableButtons: function () {
+ _disableButtons: function () {
if (this.$buttons) {
this.$buttons.find('button').attr('disabled', true);
}
@@ -341,10 +341,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);
@@ -355,7 +353,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
*
* @private
*/
- _enableButtons: function () {
+ _enableButtons: function () {
if (this.$buttons) {
this.$buttons.find('button').removeAttr('disabled');
}