[FIX] base: rendering PDF should save ir.attachment

Printing an invoice no longer saved the ir.attachment on the
move.
This is due to the refactor in ffc525419a,
since the render methods are now `api.model`, `self.attachment` was always
Falsy. To get the attachment name of a report, we need to call
`self._get_report(report_ref)`.

closes odoo/odoo#100363

Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
Julien Van Roy
2022-09-19 11:28:59 +02:00
parent 42237c0ddc
commit f535de2c28
+1 -1
View File
@@ -799,7 +799,7 @@ class IrActionsReport(models.Model):
report_sudo = self._get_report(report_ref)
# Generate the ir.attachment if needed.
if self.attachment:
if report_sudo.attachment:
attachment_vals_list = []
for res_id, stream_data in collected_streams.items():
# An attachment already exists.