Skip to content

Commit 46d9440

Browse files
author
Laurent Stukkens
committed
[FIX] mis_builder: correctly compute context in mis_report_widget
This commit ensure that the context used by the `mis_report_widget` widget RPC calls is correctly computed. Previously using the `mis_analytic_domain` context key was useless as not taken into account in the widget.
1 parent 92f5680 commit 46d9440

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: mis_builder/static/src/components/mis_report_widget.esm.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import {Component, onWillStart, useState, useSubEnv} from "@odoo/owl";
44
import {useBus, useService} from "@web/core/utils/hooks";
55
import {DatePicker} from "@web/core/datepicker/datepicker";
6+
import {Domain} from "@web/core/domain";
67
import {FilterMenu} from "@web/search/filter_menu/filter_menu";
78
import {SearchBar} from "@web/search/search_bar/search_bar";
89
import {SearchModel} from "@web/search/search_model";
@@ -104,11 +105,16 @@ export class MisReportWidget extends Component {
104105
}
105106

106107
get context() {
107-
var ctx = super.context;
108-
if (this.showSearchBar) {
108+
let ctx = this.props.record.context;
109+
if (this.showSearchBar && this.searchModel.searchDomain) {
109110
ctx = {
110111
...ctx,
111-
mis_analytic_domain: this.searchModel.searchDomain,
112+
mis_analytic_domain: Domain.and([
113+
new Domain(
114+
this.props.record.context.mis_analytic_domain || Domain.TRUE
115+
),
116+
new Domain(this.searchModel.searchDomain),
117+
]).toList(),
112118
};
113119
}
114120
if (this.showPivotDate && this.state.pivot_date) {

0 commit comments

Comments
 (0)