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

[FIX] web: pivot: keep subTrees in comparison mode


Before this commit, when comparing a period P of reference to another one,
some rows with only data comming from P would not always be presented
in the table. The problem used to manifest only when loading at least to
level at the same time (starting from Total or any header via expand all).

The reason is the following:
- the data comming from P are processed first: starting from somewhere
  in the trees of headers, some nodes linked to the data comming from P
  are progressively created with no children at first, then the children
  (if any) are added later and so on progressively.
- the data comming from the other period is processed and nodes are
  created with no children and so on in the same way, clearing possibly
  all the node children comming from P.

For example, with
  a row groupby = [field_a, field_b],
  a group [v, v1] from P
  a group [v, v2] from the other period,
a node corresponding to v would be added, then a node child for v1.
Then the node for v would be recreated with no children, then a node child
for v2 would be created. leading to a tree of row headers of the form
Total > v > v2.

Note that it was not affecting the measure values for the displayed rows
since those measures are stored separately from the tree and are linked
to the nodes via some ids.

We fix the problem by avoiding the recreation of a node if it already
exists.

opw-2635113

closes odoo/odoo#79580

Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
Co-authored-by: default avatarMathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: default avatarAndrea Grazioso <agr@odoo.com>
parent dfb0ce4b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment