[MIG] web_ir_actions_act_view_reload: Migration to 12.0

[UPD] Update web_ir_actions_act_view_reload.pot

[UPD] README.rst
This commit is contained in:
Alexey Pelykh
2018-11-19 18:30:15 +02:00
committed by Ryan Cole
parent 6151a3cffb
commit bdd8e89e0e
10 changed files with 563 additions and 27 deletions

View File

@@ -1,16 +1,38 @@
// Copyright 2017 - 2018 Modoolar <info@modoolar.com>
// Copyright 2018 Modoolar <info@modoolar.com>
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
odoo.define('web_ir_actions_act_view_reload.ir_actions_act_view_reload', function (require) {
"use strict";
"use strict";
var ActionManager = require('web.ActionManager');
ActionManager.include({
ir_actions_act_view_reload: function (action, options) {
if (this.inner_widget && this.inner_widget.active_view && this.inner_widget.active_view.controller)
this.inner_widget.active_view.controller.reload();
/**
* Intersept action handling to detect extra action type
* @override
*/
_handleAction: function (action, options) {
if (action.type === 'ir.actions.act_view_reload') {
return this._executeReloadAction(action, options);
}
return this._super.apply(this, arguments);
},
/**
* Handle 'ir.actions.act_view_reload' action
* @returns {$.Promise}
*/
_executeReloadAction: function () {
var controller = this.getCurrentController();
if (controller && controller.widget) {
controller.widget.reload();
}
return $.when();
}
},
});
});