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.

35 lines
1.3 KiB

  1. odoo.define("account_financial_report.ReportActionManager", function(require) {
  2. "use strict";
  3. const ActionManager = require("web.ActionManager");
  4. require("web.ReportActionManager");
  5. ActionManager.include({
  6. /**
  7. * @override
  8. */
  9. _executeReportClientAction: function(action, options) {
  10. const MODULE_NAME = "account_financial_report";
  11. // When 'report_action' is called from the backend, Odoo hardcodes the action tag.
  12. // We have to make a hack to use our own report controller.
  13. if (action.report_file.startsWith(`${MODULE_NAME}.`)) {
  14. const urls = this._makeReportUrls(action);
  15. const clientActionOptions = _.extend({}, options, {
  16. context: action.context,
  17. data: action.data,
  18. display_name: action.display_name,
  19. name: action.name,
  20. report_file: action.report_file,
  21. report_name: action.report_name,
  22. report_url: urls.html,
  23. });
  24. return this.doAction(
  25. "account_financial_report.client_action",
  26. clientActionOptions
  27. );
  28. }
  29. return this._super.apply(this, arguments);
  30. },
  31. });
  32. });