|
@ -14,17 +14,19 @@ odoo.define("report_substitute.action_report_substitute", function (require) { |
|
|
|
|
|
|
|
|
_handleAction: function (action, options) { |
|
|
_handleAction: function (action, options) { |
|
|
if (action.type === "ir.actions.report" && |
|
|
if (action.type === "ir.actions.report" && |
|
|
action.context.active_ids) { |
|
|
|
|
|
|
|
|
action.context.active_ids && |
|
|
|
|
|
action.action_report_substitution_rule_ids && |
|
|
|
|
|
action.action_report_substitution_rule_ids != 0) { |
|
|
var active_ids = action.context.active_ids; |
|
|
var active_ids = action.context.active_ids; |
|
|
var self = this; |
|
|
var self = this; |
|
|
var _super = this._super; |
|
|
var _super = this._super; |
|
|
var callersArguments = arguments; |
|
|
var callersArguments = arguments; |
|
|
return this._rpc({ |
|
|
return this._rpc({ |
|
|
model: "ir.actions.report", |
|
|
model: "ir.actions.report", |
|
|
method: "get_substitution_report_dict", |
|
|
|
|
|
|
|
|
method: "get_substitution_report_action", |
|
|
args: [action, active_ids] |
|
|
args: [action, active_ids] |
|
|
}).then(function (action_id) { |
|
|
|
|
|
callersArguments[0] = action_id |
|
|
|
|
|
|
|
|
}).then(function (substitution_action) { |
|
|
|
|
|
callersArguments[0] = substitution_action |
|
|
return _super.apply(self, callersArguments); |
|
|
return _super.apply(self, callersArguments); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|