diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-27 14:53:49 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-27 14:53:49 +0700 |
| commit | 491a66b7245379c23d0555c29d0d9d7861013144 (patch) | |
| tree | b4aa1aa05718cbddaa803f1beeb8dd3d42eb1ee6 | |
| parent | 2103a438acc24ad44965b869a28a15424838c9b5 (diff) | |
<miqdad> sum total qty sold
| -rw-r--r-- | indoteknik_custom/models/solr/promotion_program_line.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py index 64ad4209..4eafb9ac 100644 --- a/indoteknik_custom/models/solr/promotion_program_line.py +++ b/indoteknik_custom/models/solr/promotion_program_line.py @@ -64,7 +64,7 @@ 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], + 'total_qty_sold_f': sum([x.product_id.qty_sold for x in rec.product_ids]), 'active_b': rec.active, "manufacture_name_s": rec.product_ids.product_id.x_manufacture.x_name or '', "category_name": category_names, |
