Files
odoo_source/addons/spreadsheet
Rémi Rahir 8f379d8ae5 [FIX] spreadsheet: Fix Odoo chart duplication
Odoo charts have a specific need of dataSources for their runtime data
(in oppostion to standard graphs). In order to link the chart with its
datasource, we injected the chart id inside its definition in order to
be able to fetch the corresponding datasource. Unfortunately, this
approach require that we can access the chartId from anywhere which is
unfortunately not the case when we copy/cut/paste a chart. The current
implementation would copy the chart while keeping a reference to the
same datasource, thereby keeping the same data and be submitted to the
same filters as the original chart dataSource.

Note that a chart should not be aware of its own id; that is, its place
in the mapping of a plugin.

This commit changes the approach to set the dataSource inside the chart
directly through a method only available on OdooChart instances.

This problem would also arise on sheet duplication but was due to a
problem in the library itself.

task 2998207

closes odoo/odoo#101660

X-original-commit: 47f7cc08bec749301001c6c4567cafbcea8bd552
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-30 09:31:55 +02:00
..
2022-09-30 09:31:52 +02:00