diff --git a/product_print_category_supermarket/models/product_template.py b/product_print_category_supermarket/models/product_template.py index fe667f1..6539b1c 100644 --- a/product_print_category_supermarket/models/product_template.py +++ b/product_print_category_supermarket/models/product_template.py @@ -18,10 +18,17 @@ class ProductTemplate(models.Model): ) pricelist = self.env["product.pricelist"].browse(int(param_value)) price = pricelist._get_product_price(self, 1) - return price + taxes = self.taxes_id.compute_all(price, quantity=1, product=self) + return taxes["total_included"] @api.model def get_price_public(self): - pricelist = self.env.ref("product.list0") + param_value = ( + self.env["ir.config_parameter"] + .sudo() + .get_param("report_label_supermarket.label_public_pricelist") + ) + pricelist = self.env["product.pricelist"].browse(int(param_value)) price = pricelist._get_product_price(self, 1) - return price + taxes = self.taxes_id.compute_all(price, quantity=1, product=self) + return taxes["total_included"] diff --git a/product_print_category_supermarket/models/res_config.py b/product_print_category_supermarket/models/res_config.py index a5d8220..df5aa4d 100644 --- a/product_print_category_supermarket/models/res_config.py +++ b/product_print_category_supermarket/models/res_config.py @@ -10,3 +10,10 @@ class ResConfigSettings(models.TransientModel): string="Pricelist for members", config_parameter="report_label_supermarket.label_pricelist", ) + + label_public_pricelist = fields.Many2one( + required=False, + comodel_name="product.pricelist", + string="Pricelist for public", + config_parameter="report_label_supermarket.label_public_pricelist", + ) diff --git a/product_print_category_supermarket/views/report_pricetag_normal.xml b/product_print_category_supermarket/views/report_pricetag_normal.xml index ac15d03..7e8b672 100644 --- a/product_print_category_supermarket/views/report_pricetag_normal.xml +++ b/product_print_category_supermarket/views/report_pricetag_normal.xml @@ -26,13 +26,23 @@