From c136e5d34dfef4ae95c366b5c52197863b967919 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 17 Oct 2023 09:54:42 +0700 Subject: Fix product virtual rating calculation --- indoteknik_custom/models/product_template.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index da1a111f..d8a2aae2 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -188,12 +188,7 @@ class ProductTemplate(models.Model): def _compute_web_price(self): for template in self: - products = self.env['product.product'].search([ - ('product_tmpl_id', '=', template.id), - ('active', 'in', [True, False]) - ]) - for variants in products: - template.web_price = variants[0].web_price + template.web_price = template.product_variant_id.web_price def _have_promotion_program(self): for template in self: -- cgit v1.2.3