summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-11-14 16:19:19 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-11-14 16:19:19 +0700
commitf1bf6c4cfa31446a15e5678a80c023cadba64f86 (patch)
treebb9f9d013a17df500ac82bbb1c766cdae90c2656
parent93f431a8d96bb46cb34ad9629d450b34a531265c (diff)
<Miqdad> fix ccm
-rw-r--r--indoteknik_custom/models/tukar_guling.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py
index c8375161..aa116ce3 100644
--- a/indoteknik_custom/models/tukar_guling.py
+++ b/indoteknik_custom/models/tukar_guling.py
@@ -737,12 +737,18 @@ class TukarGuling(models.Model):
if mapping_koli and record.operations.picking_type_id.id == 29:
for prod in mapping_koli.mapped('product_id'):
qty_total = sum(mk.qty_return for mk in mapping_koli.filtered(lambda m: m.product_id == prod))
- for ml in bu_out.move_line_ids.filtered(lambda ml: ml.qty_done > 0 and not ml.package_id):
+
+ move_lines = bu_out.move_line_ids.filtered(
+ lambda ml: ml.product_id == prod and ml.qty_done > 0 and not ml.package_id
+ )
+
+ for ml in move_lines:
srt_return_lines.append((0, 0, {
'product_id': ml.product_id.id,
'quantity': ml.qty_done,
'move_id': ml.move_id.id,
}))
+
_logger.info(f"📟 SRT line: {prod.display_name} | qty={qty_total}")
elif not mapping_koli and record.operations.picking_type_id.id == 29: