diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-07-29 15:32:55 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-07-29 15:32:55 +0700 |
| commit | f369c55dc0b696449eddad6cd30f2db285b49542 (patch) | |
| tree | 5dc791e2e183677fbc9fa3b716a8ef635d63b7e8 | |
| parent | cec124ff1de94761e4394620eb471b2246f23940 (diff) | |
cr virtual rating
| -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': |
