summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-08 11:20:54 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-08 11:20:54 +0700
commitf4f550e9597a7dc9765ff46fc6af0ebb8fae6888 (patch)
tree6c20c8d762b4ae3c70c3d3467de4079b636bd7a9
parent2788fde55af0826b74986473ebcc1041a1864932 (diff)
<iman> ubah nilai 0 sequence i menjadi null
-rw-r--r--indoteknik_custom/models/solr/promotion_program_line.py5
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],