odoo/odoo#265658

Created by fw-bot
Merged at 3f47096b88fe42675e2b6ec35cca884446259a04

Statuses:

label
odoo-dev:saas-19.3-19.0-opw-6207518-evlin-528512-fw
head
f7be5c267274aacfadda2b8c8ff6d09149cd95a0
merged
3 weeks ago by Eve Lin (evlin)
odoo/odoo
19.0 #264841
saas-19.1 #265585
saas-19.2 #265626
saas-19.3 #265658
master #265683

[FIX] account: distinct fallback names for dynamic reports

Problem:
When adding additional dynamic reports to the “Invoice: Send by Email” template, reports without a configured print_report_name incorrectly use the invoice filename. This is an issue because multiple attachments can have the same exact filename.

Example from related ticket: the user attached timesheets to their template and both the invoice PDF and timesheet attachment used the same filename.

Expected:
The additional report should use its own fallback filename (ex: timesheets_INV_XXX.pdf) or its configured
print_report_name.

Actual:
The additional report uses the invoice filename instead.

To fix this, reports without print_report_name now fallback to: <report name>_<invoice name>.pdf as done in v18.0

Related Ticket: 6207518 and 6175376

Forward-Port-Of: #264841