From 2446efd419fe3521731a15fea28f77cea337e75a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 21 Oct 2023 00:04:23 +0200 Subject: [PATCH] [FIX] sale_order_ubl: fix crash when closing POS session --- sale_order_ubl/models/report.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sale_order_ubl/models/report.py b/sale_order_ubl/models/report.py index bfa3213205..f354be2ab0 100644 --- a/sale_order_ubl/models/report.py +++ b/sale_order_ubl/models/report.py @@ -29,6 +29,8 @@ def _post_pdf(self, save_in_attachment, pdf_content=None, res_ids=None): def _render_qweb_pdf(self, res_ids=None, data=None): """This is only necessary when tests are enabled. It forces the creation of pdf instead of html.""" + if isinstance(res_ids, int): + res_ids = [res_ids] if len(res_ids or []) == 1 and not self.env.context.get("no_embedded_ubl_xml"): if len(self) == 1 and self.is_ubl_xml_to_embed_in_sale_order(): self = self.with_context(force_report_rendering=True)