summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/abstract_controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/views/abstract_controller.js')
-rw-r--r--addons/web/static/src/js/views/abstract_controller.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js
index f1356f72a81..995a5102c37 100644
--- a/addons/web/static/src/js/views/abstract_controller.js
+++ b/addons/web/static/src/js/views/abstract_controller.js
@@ -14,11 +14,11 @@ odoo.define('web.AbstractController', function (require) {
var ControlPanelMixin = require('web.ControlPanelMixin');
var core = require('web.core');
-var Widget = require('web.Widget');
+var AbstractAction = require('web.AbstractAction');
var QWeb = core.qweb;
-var AbstractController = Widget.extend(ControlPanelMixin, {
+var AbstractController = AbstractAction.extend(ControlPanelMixin, {
custom_events: {
open_record: '_onOpenRecord',
switch_view: '_onSwitchView',
@@ -108,6 +108,13 @@ var AbstractController = Widget.extend(ControlPanelMixin, {
//--------------------------------------------------------------------------
/**
+ * @override
+ */
+ canBeRemoved: function () {
+ // AAB: get rid of this option when on_hashchange mechanism is improved
+ return this.discardChanges(undefined, {readonlyIfRealDiscard: true});
+ },
+ /**
* Discards the changes made on the record associated to the given ID, or
* all changes made by the current controller if no recordID is given. For
* example, when the user opens the 'home' screen, the action manager calls
@@ -168,15 +175,6 @@ var AbstractController = Widget.extend(ControlPanelMixin, {
return this.update(params || {});
},
/**
- * Renders the buttons to append, in most cases, to the control panel (in
- * the bottom left corner). When the view is rendered in a dialog, those
- * buttons might be moved to the dialog's footer.
- *
- * @param {jQuery Node} $node
- */
- renderButtons: function ($node) {
- },
- /**
* For views that require a pager, this method will be called to allow the
* controller to instantiate and render a pager. Note that in theory, the
* controller can actually render whatever he wants in the pager zone. If