Skip to content
Snippets Groups Projects
Commit 92a1f215 authored by Mathieu Duckerts-Antoine's avatar Mathieu Duckerts-Antoine
Browse files

[FIX] web: pie chart structure not modified by favorites


A pie chart widget aims to instantiate a graph view in mode
'pie', with a measure and a single groupby specified via some
attributes. It turns out that if a pie chart is instantiated
in a context in which the keys 'graph_mode', 'graph_measure',
and 'graph_groupbys' are present, that keys prevail over the
pie chart specification. This can produce a line chart for
instance. This fix corrects that situation.

A test has been added in a corresponding commit in enterprise
(historically, the pie chart widgets are tested in dashboard
views).

closes odoo/odoo#34234

Signed-off-by: default avatarVincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
parent ba2c179c
Branches
Tags
No related merge requests found
......@@ -34,8 +34,13 @@ var PieChart = Widget.extend({
title: node.attrs.title || modifiers.title || modifiers.measure,
});
var pieChartContext = JSON.parse(JSON.stringify(record.context));
delete pieChartContext.graph_mode;
delete pieChartContext.graph_measure;
delete pieChartContext.graph_groupbys;
this.subViewParams = {
context: record.context,
context: pieChartContext,
domain: domain,
groupBy: [],
modelName: record.model,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment