From e6a688815ff8ee31c5f3fcd8dbf09fd527aedd5d Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Thu, 22 Jun 2023 13:37:43 +0000 Subject: [PATCH] [FIX] product: Add missing api.depends to _compute_product_price_extra Field `product.product.lst_price` is not recomputed after changing `product.template.attribute.value.price_extra`. Computation of `product.product.lst_price` is not triggered because `product.product.price_extra` is not recomputed because of the missing decorator. closes odoo/odoo#126968 X-original-commit: c7034cb9973532da8011f5fc78d50d859b704500 Signed-off-by: Victor Feyens (vfe) --- addons/product/models/product_product.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/product/models/product_product.py b/addons/product/models/product_product.py index d382f30a486..9a952b3cce7 100644 --- a/addons/product/models/product_product.py +++ b/addons/product/models/product_product.py @@ -226,6 +226,7 @@ class ProductProduct(models.Model): value -= product.price_extra product.write({'list_price': value}) + @api.depends("product_template_attribute_value_ids.price_extra") def _compute_product_price_extra(self): for product in self: product.price_extra = sum(product.product_template_attribute_value_ids.mapped('price_extra'))