diff --git a/purchase_order_ubl/models/report.py b/purchase_order_ubl/models/report.py index 4573055f16..0a23d4b014 100644 --- a/purchase_order_ubl/models/report.py +++ b/purchase_order_ubl/models/report.py @@ -16,9 +16,12 @@ def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None): report_sudo = self._get_report(report_ref) records = self.env[report_sudo.model].browse(res_ids) for record in records: - collected_streams[record.id]["stream"] = record.add_xml_in_pdf_buffer( - collected_streams[record.id]["stream"] - ) + if record.is_ubl_xml_to_embed_in_purchase_order(): + collected_streams[record.id][ + "stream" + ] = record.add_xml_in_pdf_buffer( + collected_streams[record.id]["stream"] + ) return collected_streams def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):