Skip to content

[FIX] pivot: unused pivot detection#8740

Closed
fw-bot wants to merge 2 commits into
saas-18.4from
saas-18.4-18.0-fix-unused-pivot-adrm-527383-fw
Closed

[FIX] pivot: unused pivot detection#8740
fw-bot wants to merge 2 commits into
saas-18.4from
saas-18.4-18.0-fix-unused-pivot-adrm-527383-fw

Conversation

@fw-bot
Copy link
Copy Markdown
Collaborator

@fw-bot fw-bot commented May 18, 2026

Description:

[FIX] pivot: unused pivot detection with composed formula

If a formula has two pivots (eg. =PIVOT(1) + PIVOT(2)), the
second pivot will not be detected as used.

[FIX] pivot: unused pivot detection with calculated measure

If a pivot has a calculated measure that refers to a second pivot,
the second pivot is not detected as used. This commit fixes that.

Note: the fix does not fix 100% of the issues. A pivot only referenced
in other places (eg. in a CF rule formula) will still not be
detected as used. But checking every other place the pivot can be
referenced is expensive and error-prone. That may be done in master.

Task: 6105894

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: #8738
Forward-Port-Of: #8539

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented May 18, 2026

Pull request status dashboard

@fw-bot
Copy link
Copy Markdown
Collaborator Author

fw-bot commented May 18, 2026

@hokolomopo @LucasLefevre cherrypicking of pull request #8539 failed.

stdout:

Auto-merging src/plugins/ui_core_views/pivot_ui.ts
CONFLICT (content): Merge conflict in src/plugins/ui_core_views/pivot_ui.ts
Auto-merging tests/pivots/pivot_plugin.test.ts

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

If a pivot has a calculated measure that refers to a second pivot,
the second pivot is not detected as used. This commit fixes that.

Note: the fix does not fix 100% of the issues. A pivot only referenced
in other places (eg. in a CF rule formula) will still not be
detected as used. But checking every other place the pivot can be
referenced is expensive and error-prone. That may be done in master.

Task: 6105894
@hokolomopo hokolomopo force-pushed the saas-18.4-18.0-fix-unused-pivot-adrm-527383-fw branch from 85672b7 to 63e3d3d Compare May 18, 2026 11:20
@hokolomopo
Copy link
Copy Markdown
Contributor

@robodoo r+ rebase-ff

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented May 18, 2026

Merge method set to rebase and fast-forward.

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented May 18, 2026

@hokolomopo @LucasLefevre 'ci/runbot' failed on this reviewed PR.

If a formula has two pivots (eg. `=PIVOT(1) + PIVOT(2)`), the
second pivot will not be detected as used.

Task: 6105894
@hokolomopo hokolomopo force-pushed the saas-18.4-18.0-fix-unused-pivot-adrm-527383-fw branch from 63e3d3d to 539b4a5 Compare May 18, 2026 13:04
@hokolomopo
Copy link
Copy Markdown
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request May 18, 2026
If a pivot has a calculated measure that refers to a second pivot,
the second pivot is not detected as used. This commit fixes that.

Note: the fix does not fix 100% of the issues. A pivot only referenced
in other places (eg. in a CF rule formula) will still not be
detected as used. But checking every other place the pivot can be
referenced is expensive and error-prone. That may be done in master.

Task: 6105894
Part-of: #8740
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
robodoo pushed a commit that referenced this pull request May 18, 2026
If a formula has two pivots (eg. `=PIVOT(1) + PIVOT(2)`), the
second pivot will not be detected as used.

closes #8740

Task: 6105894
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
@robodoo robodoo closed this May 18, 2026
@fw-bot fw-bot mentioned this pull request May 18, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants