[FIX] account: distinct fallback names for dynamic reports#264841
Closed
evlin-odoo wants to merge 1 commit into
Closed
[FIX] account: distinct fallback names for dynamic reports#264841evlin-odoo wants to merge 1 commit into
evlin-odoo wants to merge 1 commit into
Conversation
Contributor
Contributor
Author
|
Hi @svfu-odoo ! Would you mind taking another look at this one when you have a chance? It turned out there was a side effect from the previous fix: #259975 Since I didn’t modify the helper function in the 19.0 forward-port, I didn’t realize the existing fallback with self.name would cause additional dynamic reports without print_report_name to use the invoice filename. Thanks |
svfu-odoo
reviewed
May 18, 2026
3f53595 to
09715b0
Compare
svfu-odoo
reviewed
May 19, 2026
Comment on lines
+275
to
+277
| filename = move._get_invoice_report_filename(report=extra_mail_template) | ||
| if not extra_mail_template.print_report_name: | ||
| filename = f'{extra_mail_template.name.lower()}_{move.name}.pdf' |
Contributor
There was a problem hiding this comment.
Why not if / else? It seem unnecessary to compute the filename just to override it
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
09715b0 to
fb9fe32
Compare
svfu-odoo
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem:
When adding additional dynamic reports to the “Invoice: Send by Email” template, reports without a configured
print_report_nameincorrectly 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 configuredprint_report_name.Actual:
The additional report uses the invoice filename instead.
To fix this, reports without
print_report_namenow fallback to:<report name>_<invoice name>.pdfas done in v18.0Related Ticket: 6207518 and 6175376