diff --git a/addons/product/report/product_label_report.py b/addons/product/report/product_label_report.py index a3fd37e68ed..31bf0aa0888 100644 --- a/addons/product/report/product_label_report.py +++ b/addons/product/report/product_label_report.py @@ -10,6 +10,8 @@ from odoo.exceptions import UserError def _prepare_data(env, docids, data): # change product ids by actual product object to get access to fields in xml template # we needed to pass ids because reports only accepts native python types (int, float, strings, ...) + + layout_wizard = env['product.label.layout'].browse(data.get('layout_wizard')) if data.get('active_model') == 'product.template': Product = env['product.template'].with_context(display_default_code=False) elif data.get('active_model') == 'product.product': @@ -23,11 +25,11 @@ def _prepare_data(env, docids, data): return { 'quantity': quantity_by_product, 'page_numbers': 1, + 'pricelist': layout_wizard.pricelist_id, } else: raise UserError(_('Product model not defined, Please contact your administrator.')) - layout_wizard = env['product.label.layout'].browse(data.get('layout_wizard')) if not layout_wizard: return {}