[FIX] spreadsheet: re-insert pivot w/ contextual domain
Re-inserting a pivot that had a contextual domain would fail because the data source would try to fetch the data with the domain as a string, but the domain should be a list at this point. Task: 3553122 Part-of: odoo/odoo#138733
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { OdooViewsDataSource } from "../data_sources/odoo_views_data_source";
|
||||
import { SpreadsheetPivotModel } from "./pivot_model";
|
||||
import { Domain } from "@web/core/domain";
|
||||
|
||||
export class PivotDataSource extends OdooViewsDataSource {
|
||||
/**
|
||||
@@ -47,7 +48,15 @@ export class PivotDataSource extends OdooViewsDataSource {
|
||||
metadataRepository: this._metadataRepository,
|
||||
}
|
||||
);
|
||||
await model.load(this._initialSearchParams);
|
||||
|
||||
const userContext = this._orm.user.context;
|
||||
const domain = new Domain(this._initialSearchParams.domain).toList({
|
||||
...this._initialSearchParams.context,
|
||||
...userContext,
|
||||
});
|
||||
|
||||
const searchParams = { ...this._initialSearchParams, domain };
|
||||
await model.load(searchParams);
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user