Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

rmbh-odoo
Copy link
Contributor

@rmbh-odoo rmbh-odoo commented Jul 16, 2025

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

@robodoo
Copy link
Collaborator

robodoo commented Jul 16, 2025

Pull request status dashboard

@rmbh-odoo rmbh-odoo force-pushed the saas-18.2-fix-sum-of-duration-pivot-rmbh branch from d4f22d3 to 4f755c0 Compare July 23, 2025 10:04
@rmbh-odoo rmbh-odoo changed the title [FIX] pivot: show AVG and SUM aggregators for duration fields [FIX] pivot: support SUM and AVG aggregators for duration fields Jul 23, 2025
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

@rmbh-odoo rmbh-odoo force-pushed the saas-18.2-fix-sum-of-duration-pivot-rmbh branch from 4f755c0 to 0cf015a Compare July 24, 2025 08:59
Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except the small comment to simplify the component test 👍

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.

Before this commit:
- 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

After this commit:
- SUM and AVG aggregators are supported for datetime fields,
- Allowing meaningful aggregation of duration values in pivot tables.

Task:  4945217
@rmbh-odoo rmbh-odoo force-pushed the saas-18.2-fix-sum-of-duration-pivot-rmbh branch from 0cf015a to 7a840fc Compare July 29, 2025 08:46
Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
robodoo r+

robodoo pushed a commit that referenced this pull request Jul 29, 2025
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.

Before this commit:
- 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

After this commit:
- SUM and AVG aggregators are supported for datetime fields,
- Allowing meaningful aggregation of duration values in pivot tables.

closes #6809

Task:  4945217
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
@robodoo robodoo closed this Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants