diff --git a/addons/account/models/ir_actions_report.py b/addons/account/models/ir_actions_report.py index 4aa8bb400c2..4c4ba1ead36 100644 --- a/addons/account/models/ir_actions_report.py +++ b/addons/account/models/ir_actions_report.py @@ -29,4 +29,7 @@ class IrActionsReport(models.Model): # don't save the 'account.report_original_vendor_bill' report as it's just a mean to print existing attachments if self.report_name == 'account.report_original_vendor_bill': return None - return super(IrActionsReport, self)._postprocess_pdf_report(record, buffer) + res = super(IrActionsReport, self)._postprocess_pdf_report(record, buffer) + if self.model == 'account.move' and record.is_sale_document(include_receipts=True): + self.retrieve_attachment(record).register_as_main_attachment(force=False) + return res