diff --git a/addons/account/models/ir_actions_report.py b/addons/account/models/ir_actions_report.py index 716d61a1a762254f0a3ade5f3580293b780fc66e..947bec15fb64795cbcb14ef06d0c533e1e750fde 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