From f1bf6c4cfa31446a15e5678a80c023cadba64f86 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Fri, 14 Nov 2025 16:19:19 +0700 Subject: fix ccm --- indoteknik_custom/models/tukar_guling.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3