diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-07-08 04:22:02 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-07-08 04:22:02 +0000 |
| commit | 3da4b60ea121b5f08bb066267773c992c1e1dd21 (patch) | |
| tree | 2d064369f41521584782d2260c32c08c4479ede1 | |
| parent | 4ff0784ecca82796493f4311983ed8194b8e4723 (diff) | |
| parent | f4f550e9597a7dc9765ff46fc6af0ebb8fae6888 (diff) | |
Merged in feature/iman_sequence (pull request #156)
<iman> ubah nilai 0 sequence i menjadi 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..f3f890e4 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 it was 0 + sequence_i = 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_i, '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], |
