diff --git a/odoo/addons/base/models/ir_actions_report.py b/odoo/addons/base/models/ir_actions_report.py index ab1750f7e9c3f65306898b551c090c2600f08a83..ec7263aebd7c3905de538394f1234611b1cbef18 100644 --- a/odoo/addons/base/models/ir_actions_report.py +++ b/odoo/addons/base/models/ir_actions_report.py @@ -178,8 +178,9 @@ class IrActionsReport(models.Model): if attachment.mimetype.startswith('image'): stream = io.BytesIO(base64.b64decode(attachment.datas)) img = Image.open(stream) - img.convert("RGB").save(stream, format="pdf") - return stream + output_stream = io.BytesIO() + img.convert("RGB").save(output_stream, format="pdf") + return output_stream return io.BytesIO(base64.decodestring(attachment.datas)) def retrieve_attachment(self, record):