From 168b56e0698e443508049cdb3507d1170a21725c Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Sat, 30 Sep 2023 08:45:41 +0300 Subject: [PATCH] [IMP] product: pricelist option in label printing before this commit, on printing product labels there is no option to select the price list, always the printed price is the default product price after this commit, in the label printing wizard the price list field is introduced and user can select the price list before printing the labels closes odoo/odoo#137190 Signed-off-by: Victor Feyens (vfe) --- addons/product/report/product_label_report.py | 1 + .../report/product_product_templates.xml | 32 +++++-------------- addons/product/wizard/product_label_layout.py | 1 + .../wizard/product_label_layout_views.xml | 1 + 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/addons/product/report/product_label_report.py b/addons/product/report/product_label_report.py index f2c0b3bcb61..6a934f2d4f8 100644 --- a/addons/product/report/product_label_report.py +++ b/addons/product/report/product_label_report.py @@ -43,6 +43,7 @@ def _prepare_data(env, data): 'page_numbers': (total - 1) // (layout_wizard.rows * layout_wizard.columns) + 1, 'price_included': data.get('price_included'), 'extra_html': layout_wizard.extra_html, + 'pricelist': layout_wizard.pricelist_id, } class ReportProductTemplateLabel(models.AbstractModel): diff --git a/addons/product/report/product_product_templates.xml b/addons/product/report/product_product_templates.xml index 794d53bd41d..4268b451dcf 100644 --- a/addons/product/report/product_product_templates.xml +++ b/addons/product/report/product_product_templates.xml @@ -21,12 +21,8 @@
- - - - - - +
@@ -43,12 +39,8 @@
- - - - - - +
@@ -74,12 +66,8 @@
- - - - - - +
@@ -117,12 +105,8 @@
- - - - - - +
diff --git a/addons/product/wizard/product_label_layout.py b/addons/product/wizard/product_label_layout.py index 2efe462548b..df4a74aa620 100644 --- a/addons/product/wizard/product_label_layout.py +++ b/addons/product/wizard/product_label_layout.py @@ -22,6 +22,7 @@ class ProductLabelLayout(models.TransientModel): extra_html = fields.Html('Extra Content', default='') rows = fields.Integer(compute='_compute_dimensions') columns = fields.Integer(compute='_compute_dimensions') + pricelist_id = fields.Many2one('product.pricelist', string="Pricelist") @api.depends('print_format') def _compute_dimensions(self): diff --git a/addons/product/wizard/product_label_layout_views.xml b/addons/product/wizard/product_label_layout_views.xml index 6d14b5ad2e3..102365dbc26 100644 --- a/addons/product/wizard/product_label_layout_views.xml +++ b/addons/product/wizard/product_label_layout_views.xml @@ -14,6 +14,7 @@ +