odoo/o-spreadsheet#6878

Created by fw-bot
Merged at 4974618995b7c9657b9f762fd490f05a43a5f0fb

Statuses:

label
odoo:saas-18.4-saas-18.2-fix-sum-of-duration-pivot-rmbh-453352-fw
head
6ea62122a6d712c6e6095671917d8571877ab7d8
merged
1 week ago by BI, Lucas Lefèvre (lul)
odoo/o-spreadsheet
saas-18.2 #6809
saas-18.3 #6877
saas-18.4 #6878
master #6879

[FIX] pivot: support SUM and AVG aggregators for duration fields

Description:

Steps to reproduce:
- Create a pivot with a duration-formatted column.
- Go to the side panel and add the duration field to the Measures section.

Current behavior before PR:
- Datetime-formatted fields (such as durations) could not
be aggregated using SUM or AVG in pivot measures.
- This blocked users from summing or averaging durations

Desired behavior after PR is merged:
- SUM and AVG aggregators are supported for datetime fields,
- Allowing meaningful aggregation of duration values in pivot tables.

Task: 4945217

review checklist

  • [ ] feature is organized in plugin, or UI components
  • [ ] support of duplicate sheet (deep copy)
  • [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • [ ] in model/UI: ranges are strings (to show the user)
  • [ ] undo-able commands (uses this.history.update)
  • [ ] multiuser-able commands (has inverse commands and transformations where needed)
  • [ ] new/updated/removed commands are documented
  • [ ] exportable in excel
  • [ ] translations (_t("qmsdf %s", abc))
  • [ ] unit tested
  • [ ] clean commented code
  • [ ] track breaking changes
  • [ ] doc is rebuild (npm run doc)
  • [ ] status is correct in Odoo

Forward-Port-Of: #6809