From b020c4477b13eb052b5550c7fb83ea89743e21a7 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Tue, 25 Nov 2025 15:08:45 +0700 Subject: fix ccm sementara --- indoteknik_custom/models/tukar_guling.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index 99a74505..219218b4 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -737,14 +737,17 @@ 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)) - move = bu_out.move_lines.filtered(lambda m: m.product_id == prod) - if not move: + moves = bu_out.move_lines.filtered(lambda m: m.product_id == prod) + if not moves: raise UserError(f"Move BU/OUT tidak ditemukan untuk produk {prod.display_name}") - srt_return_lines.append((0, 0, { - 'product_id': prod.id, - 'quantity': qty_total, - 'move_id': move.id, - })) + + for move in moves: + srt_return_lines.append((0, 0, { + 'product_id': prod.id, + 'quantity': move.product_uom_qty, + 'move_id': move.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