summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 8f62ecc0..73504c48 100644
--- a/indoteknik_custom/models/solr/promotion_program_line.py
+++ b/indoteknik_custom/models/solr/promotion_program_line.py
@@ -26,7 +26,8 @@ class PromotionProgramLine(models.Model):
products = [{
'product_id': x.product_id.id,
- 'qty': x.qty
+ 'qty': x.qty,
+ 'qty_sold': x.product_id.qty_sold
} for x in rec.product_ids]
free_products = [{
@@ -52,8 +53,10 @@ class PromotionProgramLine(models.Model):
'free_product_ids': [x.product_id.id for x in rec.free_product_ids],
'free_products_s': json.dumps(free_products),
'total_qty_i': sum([x.qty for x in rec.product_ids] + [x.qty for x in rec.free_product_ids]),
+ 'total_qty_sold_f': [x.product_id.qty_sold for x in rec.product_ids],
'active_b': rec.active
})
+
self.solr().add([document])
self.solr().commit()