diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-27 14:27:25 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-27 14:27:25 +0700 |
| commit | 9f842a12e4875039622ac3140495b773cc39da5e (patch) | |
| tree | a9ec0ff5f8acda846db0afd729337b7fb377238a | |
| parent | df7bbe715bb49d9986d68046127410340b617713 (diff) | |
Update calculate rating product function on product_template
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 933c4676..e48136fa 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -181,18 +181,7 @@ class ProductTemplate(models.Model): for product in products: _logger.info("Calculate Rating Product %s" % product.id) - rate = 0 - if product.web_price: - rate += 1 - if product.have_promotion_program: - rate += 1 - if product.image_128: - rate += 5 - if product.website_description: - rate += 1 - if product.product_variant_id.qty_stock_vendor > 0: - rate += 1 - product.product_rating = rate + product.product_rating = product.virtual_rating product.last_calculate_rating = current_time_str def _get_stock_website(self): |
