OCA reporting engine fork for dev and update.
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.

40 lines
1.4 KiB

  1. odoo.define('report_xml.report', function(require){
  2. 'use strict';
  3. var ActionManager= require('web.ActionManager');
  4. var crash_manager = require('web.crash_manager');
  5. var framework = require('web.framework');
  6. ActionManager.include({
  7. ir_actions_report: function (action, options){
  8. var self = this;
  9. action = _.clone(action);
  10. if (action.report_type === 'qweb-xml') {
  11. framework.blockUI()
  12. var report_xml_url = 'report/xml/' + action.report_name;
  13. if(action.context.active_ids){
  14. report_xml_url += '/' + action.context.active_ids.join(',');
  15. }
  16. else{
  17. report_xml_url += '?options=' + encodeURIComponent(JSON.stringify(action.data));
  18. report_xml_url += '&context=' + encodeURIComponent(JSON.stringify(action.context));
  19. }
  20. self.getSession().get_file({
  21. url: report_xml_url,
  22. data: {data: JSON.stringify([
  23. report_xml_url,
  24. action.report_type,
  25. ])},
  26. error: crash_manager.rpc_error.bind(crash_manager),
  27. success: function (){
  28. if(action && options && !action.dialog){
  29. options.on_close();
  30. }
  31. },
  32. });
  33. framework.unblockUI();
  34. return
  35. }
  36. return self._super(action, options);
  37. }
  38. });
  39. });