diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-04 10:56:31 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-04 10:56:31 +0700 |
| commit | dd0ee7ad460b0cfdbd863e9befc5408b88f81e1e (patch) | |
| tree | 64938e97d6115212ab106111a371aeb391fd341b /indoteknik_api | |
| parent | d306603f418fe4d616226b8755e52f9dcdfdbbc9 (diff) | |
Update flash sale tag on sync solr
Diffstat (limited to 'indoteknik_api')
| -rw-r--r-- | indoteknik_api/models/product_product.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index fb485bae..ff7c6498 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -250,6 +250,7 @@ class ProductProduct(models.Model): active_flash_sale = self.env['product.pricelist'].get_active_flash_sale() flashsale_id = 0 flashsale_name = '' + flashsale_tag = '' # loop pricelist items base_price = discount = price_flashsale = 0 for pricelist in active_flash_sale: @@ -261,6 +262,7 @@ class ProductProduct(models.Model): for item in pricelist_items: flashsale_id = pricelist.id flashsale_name = pricelist.name + flashsale_tag = pricelist.flashsale_tag base_price = self._get_website_price_exclude_tax() if item.price_discount > 0: discount = item.price_discount @@ -272,6 +274,7 @@ class ProductProduct(models.Model): data = { 'flashsale_id': flashsale_id, 'flashsale_name': flashsale_name, + 'flashsale_tag': flashsale_tag, 'flashsale_base_price': base_price, 'flashsale_discount': discount, 'flashsale_price': price_flashsale |
