summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2025-11-25 15:08:45 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2025-11-25 15:08:45 +0700
commitb020c4477b13eb052b5550c7fb83ea89743e21a7 (patch)
treeb0e13ae28e19f2a9dbbcbdafaf61dfdbeee1a114
parent06b03d28c261e423c2c9a400ab33aa6225c2ed09 (diff)
<Miqdad> fix ccm sementara
-rw-r--r--indoteknik_custom/models/tukar_guling.py17
1 files 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: