odoo/o-spreadsheet#8742

Created by fw-bot
Merged at 0bb80ad94d0bf05a3590b3c3b5540230d2136126

Statuses:

label
odoo:19.0-18.0-fix-unused-pivot-adrm-527387-fw
head
b9e906bdaaed1cb1077f136b569f9d95e492c267
merged
4 days ago by BI, Adrien Minne (adrm)
odoo/o-spreadsheet
18.0 #8539
saas-18.2 #8738
saas-18.3 #8739
saas-18.4 #8740
19.0 #8742
saas-19.1 #8743
saas-19.2 #8744
saas-19.3 #8745
master #8746

[FIX] pivot: unused pivot detection

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

Forward-Port-Of: #8740
Forward-Port-Of: #8539