Skip to content

Commit

Permalink
[FIX] purchase_order_ubl: call add_xml_in_pdf_buffer only when appl…
Browse files Browse the repository at this point in the history
…icable

refs: #72272
  • Loading branch information
Laurent Stukkens committed Nov 28, 2023
1 parent ffcfef0 commit 1df3a26
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions purchase_order_ubl/models/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1df3a26

Please sign in to comment.