summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-17 09:54:42 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-17 09:54:42 +0700
commitc136e5d34dfef4ae95c366b5c52197863b967919 (patch)
treebbe4aeddf348649af547eac6ca3bc8f7ccc43c9a
parent6d9ac5debfc7f8809e627900555301aac6ab6083 (diff)
Fix product virtual rating calculation
-rwxr-xr-xindoteknik_custom/models/product_template.py7
1 files changed, 1 insertions, 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: