diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index c94b523a..56460821 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -117,18 +117,31 @@ class ProductTemplate(models.Model): for product in self: rate = 0 if product.web_price: - rate += 4 + rate += 8 if product.qty_sold > 0: - rate += 3 - if product.have_promotion_program: #have discount from pricelist rate += 5 if product.image_128: - rate += 3 + rate += 7 if product.website_description: - rate += 1 - if product.product_variant_id.qty_stock_vendor > 0: - rate += 2 + rate += 7 + if product.product_variant_id.qty_onhand_bandengan > 0: + rate += 5 + if product.product_variant_id._is_have_flashsale(): + rate += 10 product.virtual_rating = rate + # if product.web_price: + # rate += 4 + # if product.qty_sold > 0: + # rate += 3 + # if product.have_promotion_program: #have discount from pricelist + # rate += 5 + # if product.image_128: + # rate += 3 + # if product.website_description: + # rate += 1 + # if product.product_variant_id.qty_stock_vendor > 0: + # rate += 2 + # product.virtual_rating = rate def unlink(self): if self._name == 'product.template': |
