Skip to content

[17.0][FIX] account: Only set res_field=invoice_pdf_report_file on customer invoice/refunds#5551

Merged
pedrobaeza merged 1 commit intoOCA:17.0from
akretion:17-account-fix_attachment-invoice_pdf_report_file
Mar 5, 2026
Merged

[17.0][FIX] account: Only set res_field=invoice_pdf_report_file on customer invoice/refunds#5551
pedrobaeza merged 1 commit intoOCA:17.0from
akretion:17-account-fix_attachment-invoice_pdf_report_file

Conversation

@alexis-via
Copy link

Current behavior: On ir.attachment of invoices, 'res_field' is set to 'invoice_pdf_report_file' on all invoices that have 'message_main_attachment_id'
New behavior: only do that for customer invoices and refunds

Why ? Because supplier invoices/refunds can also have 'message_main_attachment_id', for example when you click on the "Upoad" button of the purchase journal on the accounting dashboard and you upload a PDF file. And we don't want res_field='invoice_pdf_report_file' on attachments of supplier invoice/refunds !

@pedrobaeza pedrobaeza added this to the 17.0 milestone Mar 5, 2026
@pedrobaeza pedrobaeza merged commit d318996 into OCA:17.0 Mar 5, 2026
4 checks passed
@pedrobaeza
Copy link
Member

The effect on this is that if the invoice is reset to draft, the attachment is auto-removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants