diff --git a/addons/web/static/src/views/graph/graph_model.js b/addons/web/static/src/views/graph/graph_model.js index 5fd8e1e745d..d72f178988f 100644 --- a/addons/web/static/src/views/graph/graph_model.js +++ b/addons/web/static/src/views/graph/graph_model.js @@ -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 = []; diff --git a/addons/web/static/tests/views/graph_view_tests.js b/addons/web/static/tests/views/graph_view_tests.js index 87f55a6dc75..f20971092f9 100644 --- a/addons/web/static/tests/views/graph_view_tests.js +++ b/addons/web/static/tests/views/graph_view_tests.js @@ -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" + ); + } + }, + }); + }); });