From 7df39dbda86fe4fb30416db7bcd2026a477b95b6 Mon Sep 17 00:00:00 2001 From: luis Date: Fri, 28 Nov 2025 09:46:37 +0100 Subject: [PATCH] product_sale_price_from_pricelist: don't update list_price when last_purchase_price_compute_type == manual_update. Add fields to tree product view --- .../models/product_template.py | 5 +++-- .../views/product_view.xml | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/product_sale_price_from_pricelist/models/product_template.py b/product_sale_price_from_pricelist/models/product_template.py index 894de69..0ac681b 100644 --- a/product_sale_price_from_pricelist/models/product_template.py +++ b/product_sale_price_from_pricelist/models/product_template.py @@ -115,8 +115,9 @@ class ProductTemplate(models.Model): def action_update_list_price(self): for template in self: - template.list_price = template.list_price_theoritical - template.last_purchase_price_updated = False + if template.last_purchase_price_compute_type != "manual_update": + template.list_price = template.list_price_theoritical + template.last_purchase_price_updated = False def price_compute( self, price_type, uom=None, currency=None, company=False, date=False diff --git a/product_sale_price_from_pricelist/views/product_view.xml b/product_sale_price_from_pricelist/views/product_view.xml index 2932212..b5d530b 100644 --- a/product_sale_price_from_pricelist/views/product_view.xml +++ b/product_sale_price_from_pricelist/views/product_view.xml @@ -28,6 +28,18 @@ + + product.template.tree.price.automatic + product.template + + + + + + + + + product.print.supermarket.res.config.settings.form res.config.settings