[FIX] web: Allow the graph context option fill_temporal to be set
The option was available before but was forgotten when the graph view was refactored. closes odoo/odoo#77330 X-original-commit: 624fd812c5d6b01c0cc11e8620dc703dc0370f73 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -414,7 +414,7 @@ export class GraphModel extends Model {
|
||||
measures,
|
||||
groupBy.map((gb) => gb.spec),
|
||||
{ lazy: false }, // what is this thing???
|
||||
{ fill_temporal: true } // + old this.chart.context
|
||||
{ fill_temporal: true, ...this.searchParams.context }
|
||||
)
|
||||
.then((data) => {
|
||||
const dataPoints = [];
|
||||
|
||||
@@ -3478,4 +3478,43 @@ QUnit.module("Views", (hooks) => {
|
||||
]);
|
||||
checkDatasets(assert, graph, "data", { data: [56, 26, 4, 105, 48] });
|
||||
});
|
||||
|
||||
QUnit.test("fill_temporal is true by default", async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const graph = await makeView({
|
||||
serverData,
|
||||
type: "graph",
|
||||
resModel: "foo",
|
||||
mockRPC: function (route, args) {
|
||||
if (args.method === "web_read_group") {
|
||||
assert.strictEqual(
|
||||
args.kwargs.context.fill_temporal,
|
||||
true,
|
||||
"The observal state of fill_temporal should be true"
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("fill_temporal can be changed throught the context", async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const graph = await makeView({
|
||||
serverData,
|
||||
type: "graph",
|
||||
resModel: "foo",
|
||||
context: { fill_temporal: false },
|
||||
mockRPC: function (route, args) {
|
||||
if (args.method === "web_read_group") {
|
||||
assert.strictEqual(
|
||||
args.kwargs.context.fill_temporal,
|
||||
false,
|
||||
"The observal state of fill_temporal should be false"
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user