diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-07-08 13:00:32 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-07-08 13:00:32 +0700 |
| commit | cb41bea5c599fb8e7df6c8076af2a5c06172c080 (patch) | |
| tree | 452e1c170bf122aeffa5724ca703d608401d5a9b | |
| parent | c2d429c26a4443e15aeec359ad54a41a7b92e904 (diff) | |
<iman> update sequence value to null
| -rw-r--r-- | indoteknik_custom/models/solr/promotion_program_line.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py index 73504c48..4b0e67f6 100644 --- a/indoteknik_custom/models/solr/promotion_program_line.py +++ b/indoteknik_custom/models/solr/promotion_program_line.py @@ -37,6 +37,9 @@ class PromotionProgramLine(models.Model): promotion_type = rec._res_promotion_type() + # Set sequence_i to None if rec.sequence is 0 + sequence_value = None if rec.sequence == 0 else rec.sequence + document.update({ 'id': rec.id, 'program_id_i': rec.program_id.id or 0, @@ -47,7 +50,7 @@ class PromotionProgramLine(models.Model): 'package_limit_user_i': rec.package_limit_user, 'package_limit_trx_i': rec.package_limit_trx, 'price_f': rec.price, - 'sequence_i': rec.sequence, + 'sequence_i': sequence_value, 'product_ids': [x.product_id.id for x in rec.product_ids], 'products_s': json.dumps(products), 'free_product_ids': [x.product_id.id for x in rec.free_product_ids], |
