odoo/enterprise#74826

Created by Accounting, Hugo Poncelet (hupo)
Merged at 8213813e68f02d88934285a44a3413505f6ca187

Statuses:

Linked pull requests
label
odoo-dev:17.0-composite_report_options_at_creation-hupo
head
97d150308b8314bbd6193b49852fbc2dddc92dd1
merged
10 months ago by Accounting, Olivier Colson (oco)
odoo/odoo odoo/enterprise
17.0 #188476 #74826
saas-17.2 #192368 #76475
saas-17.4 #192390 #76485
18.0 #192404 #76494
saas-18.1 #192414 #76497
saas-18.2
saas-18.3
saas-18.4
19.0
master #192420 #76501

[FIX] account_report: options on composite report export

Steps to reproduce
- Activate developer mode
- Go to Accounting -> Configuration -> Accounting Reports
- Create a composite report with 2 existing reports that
have the "filter_unfold_all" activated, i.e. "Balance Sheet" and "Profit and Loss"
- Create a menu item in the action of the report
- Open the report
- Press the filter "Unfold All"
- Press the "PDF" button

-> Results: the pdf has no line unfolded while they should (the web UI works as expected)

Reason of the issue:
In the dispatch_report_action() function, the get_options() was wrong and unnecessary. This function
is first called on the first section, then called on the composite report with its own options.
This led to use the options of the composite report which does not have the filter_unfold_all field
set to True.

This also handles the case where a composite report has reports A and B, A having the
filter_unfold_all while B doesn't have it. The expected result when printing it is
that only report A has unfolded lines.

task-4317649