You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

  1. // Copyright 2017 - 2018 Modoolar <info@modoolar.com>
  2. // Copyright 2018 Modoolar <info@modoolar.com>
  3. // License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. odoo.define('web_ir_actions_act_view_reload.ir_actions_act_view_reload', function (require) {
  5. "use strict";
  6. var ActionManager = require('web.ActionManager');
  7. ActionManager.include({
  8. /**
  9. * Intersept action handling to detect extra action type
  10. * @override
  11. */
  12. _handleAction: function (action, options) {
  13. if (action.type === 'ir.actions.act_view_reload') {
  14. return this._executeReloadAction(action, options);
  15. }
  16. return this._super.apply(this, arguments);
  17. },
  18. /**
  19. * Handle 'ir.actions.act_view_reload' action
  20. * @returns {$.Promise}
  21. */
  22. _executeReloadAction: function () {
  23. var controller = this.getCurrentController();
  24. if (controller && controller.widget) {
  25. controller.widget.reload();
  26. }
  27. return $.when();
  28. },
  29. });
  30. });