Skip to content
Snippets Groups Projects
Unverified Commit 75759d31 authored by Odoo's Mergebot's avatar Odoo's Mergebot Committed by GitHub
Browse files

[FW][FIX] web: Correctly aggregate values in exported parent groups


[FIX] web: Correctly aggregate values in exported parent groups
--------------------
When exporting a grouped list view with some nested groups, the aggregate value
of parent groups are not correct. It always sums aggregated values of children
whether the group operator is 'sum' or not (could be 'max', 'avg', ...).

This behavior is wrong and can even lead to a crash if the aggregated field is a
date field (e.g. with group_operator='max'). (Try two sum two dates...)

To avoid the crash a quick fix was merged 85cf47fc just before OXP. This fix
limited the support of aggregates to only int and float fields.
This commit remove this limitation.

This commit correctly implements the aggregation for parent group for all
field types and all group_operator.

This commit also improves the export feature tests.

[FIX] base export: Manage False in groupby title
--------------------
Before this commit, when we export a list with a groupby on
boolean, the groupby title 'False' is replaced by 'Undefined'
in xls document.

After this commit, with an export and groupby on a boolean, we
will have correct title: True and False.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#38896

Forward-port-of: odoo/odoo#38373
Signed-off-by: default avatarlul-odoo <LucasLefevre@users.noreply.github.com>
parents e89c818e 2bc060d1
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