Skip to content

Commit

Permalink
[FIX] mis_builder: correctly compute context in mis_report_widget
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Laurent Stukkens committed Dec 27, 2023
1 parent 92f5680 commit 46d9440
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mis_builder/static/src/components/mis_report_widget.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {Component, onWillStart, useState, useSubEnv} from "@odoo/owl";
import {useBus, useService} from "@web/core/utils/hooks";
import {DatePicker} from "@web/core/datepicker/datepicker";
import {Domain} from "@web/core/domain";
import {FilterMenu} from "@web/search/filter_menu/filter_menu";
import {SearchBar} from "@web/search/search_bar/search_bar";
import {SearchModel} from "@web/search/search_model";
Expand Down Expand Up @@ -104,11 +105,16 @@ export class MisReportWidget extends Component {
}

get context() {
var ctx = super.context;
if (this.showSearchBar) {
let ctx = this.props.record.context;
if (this.showSearchBar && this.searchModel.searchDomain) {
ctx = {
...ctx,
mis_analytic_domain: this.searchModel.searchDomain,
mis_analytic_domain: Domain.and([
new Domain(
this.props.record.context.mis_analytic_domain || Domain.TRUE
),
new Domain(this.searchModel.searchDomain),
]).toList(),
};
}
if (this.showPivotDate && this.state.pivot_date) {
Expand Down

0 comments on commit 46d9440

Please sign in to comment.