Skip to content

Conversation

@dhrp-odoo
Copy link
Contributor

Description:

When a measure is displayed as "running total" and the pivot is grouped by a date granularity (month/day/etc), PIVOT.VALUE returned an empty value for a requested bucket that does not exist in the pivot. This happened because the running-total cache only stores values for materialized pivot buckets, so a missing date key had no direct lookup.

With this commit, for date/datetime dimensions, we build an ordered index of existing buckets per secondary domain and running-total group, and use a binary search to find the nearest previous bucket. If found, we return its cumulative value (carry-forward); if the requested bucket is before the first one, we return empty.

Task: 5420999

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

When a measure is displayed as "running total" and the pivot is grouped by a
date granularity (month/day/etc), PIVOT.VALUE returned an empty value for a
requested bucket that does not exist in the pivot. This happened because the
running-total cache only stores values for materialized pivot buckets, so a
missing date key had no direct lookup.

With this commit, for date/datetime dimensions, we build an ordered index of
existing buckets per secondary domain and running-total group, and use a binary
search to find the nearest previous bucket. If found, we return its cumulative
value (carry-forward); if the requested bucket is before the first one, we
return empty.

Task: 5420999
@robodoo
Copy link
Collaborator

robodoo commented Jan 5, 2026

Pull request status dashboard

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.

2 participants