GoodERP
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.

18 lines
712B

  1. import {registry} from "@web/core/registry";
  2. import {WARNING_MESSAGE,_getReportUrl} from "./tools.esm";
  3. registry
  4. .category("ir.actions.report handlers")
  5. .add("open_report_handler", async function (action, options, env) {
  6. console.log(action.report_type);
  7. if (["docx", "qweb-pdf"].includes(action.report_type)) {
  8. const url = _getReportUrl(action, action.report_type, env);
  9. if (!window.open(url)) {
  10. console.log("WARNING_MESSAGE");
  11. env.services.notification.add(WARNING_MESSAGE, {
  12. type: "warning",
  13. });
  14. }
  15. return Promise.resolve(true);
  16. }
  17. });
上海开阖软件有限公司 沪ICP备12045867号-1