summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_controller.js13
1 files changed, 13 insertions, 0 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 24b5c7fa3d0..2847003f5df 100644
--- a/addons/web/static/src/js/views/basic/basic_controller.js
+++ b/addons/web/static/src/js/views/basic/basic_controller.js
@@ -33,6 +33,7 @@ return AbstractController.extend(FieldManagerMixin, {
this.hasButtons = params.hasButtons;
FieldManagerMixin.init.call(this, this.model);
this.handle = params.initialState.id;
+ this.isDirty = false;
},
/**
* @override
@@ -149,6 +150,18 @@ return AbstractController.extend(FieldManagerMixin, {
//--------------------------------------------------------------------------
/**
+ * We need to keep manually track of the isDirty property. Note that it is
+ * not the same as the one from the basic model. A new record from the
+ * basic model is considered dirty, but from the controller point of view,
+ * there was no user interaction and should not be dirty.
+ *
+ * @private
+ */
+ _onFieldChanged: function () {
+ this.isDirty = true;
+ FieldManagerMixin._onFieldChanged.apply(this, arguments);
+ },
+ /**
* When a reload event triggers up, we need to reload the full view.
* For example, after a form view dialog saved some data.
*