From 11e7954d23938d08e160533e047abebf6d6b4e87 Mon Sep 17 00:00:00 2001 From: thcl-odoo Date: Fri, 10 Dec 2021 13:13:08 +0000 Subject: [PATCH] [FIX] product: close 'Labels Printing' wizard after download Current behavior : When the download is finished, the wizard stay open Expected behavior : Wizard should automatically close after downloading Reason : The key `close_on_report_download` wasn't defined during new wizard implementation ( commit d9f45ba6941939b3d4b40beb5abbc330be84d695 ) OPW-2710611 closes odoo/odoo#82472 X-original-commit: e50a60573e1f9ad201d4db8607d9ff121cd476c2 Related: odoo/enterprise#23355 Signed-off-by: William Henrotin (whe) Signed-off-by: Claude Thibault (thcl) --- addons/product/wizard/product_label_layout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/product/wizard/product_label_layout.py b/addons/product/wizard/product_label_layout.py index 2fc90fe61e9..02279546444 100644 --- a/addons/product/wizard/product_label_layout.py +++ b/addons/product/wizard/product_label_layout.py @@ -67,4 +67,6 @@ class ProductLabelLayout(models.TransientModel): xml_id, data = self._prepare_report_data() if not xml_id: raise UserError(_('Unable to find report template for %s format', self.print_format)) - return self.env.ref(xml_id).report_action(None, data=data) + report_action = self.env.ref(xml_id).report_action(None, data=data) + report_action.update({'close_on_report_download': True}) + return report_action