Commit Graph
2 Commits
Author SHA1 Message Date
Nicolas Lempereur 033980a5f8 [FIX] test_xlsx_export: no warning when install w/o test_impex
This module define same `export.integer` model that is in `test_impex`
module, but do not define model access.

So if you only install `test_xlsx_export` the test will work but you
will get a warning over "The model export.integer has no access rules,
consider adding one".

opw-2204111
closes #48293

closes odoo/odoo#48308

X-original-commit: 92761b7877d63e2432cb246f5078c22b1b0f24ea
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-25 09:21:56 +00:00
Lucas Lefèvre 645ae69bb9 [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...)

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

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

This commit also improves the export feature tests.

X-original-commit: 5e7e4fa98698967e3c4fd0903f4aa8e91981a6cd
2019-10-16 15:49:49 +00:00