summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2025-11-25 15:15:11 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2025-11-25 15:15:11 +0700
commit1a764f4cc03da11c2bddd7f630f7c4650ad38cb8 (patch)
tree215c8899da114214e45b76ec92c26217812d5a85
parentb020c4477b13eb052b5550c7fb83ea89743e21a7 (diff)
<Miqdad> balikin ccm
-rw-r--r--indoteknik_custom/models/tukar_guling.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py
index 219218b4..99a74505 100644
--- a/indoteknik_custom/models/tukar_guling.py
+++ b/indoteknik_custom/models/tukar_guling.py
@@ -737,17 +737,14 @@ 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))
- moves = bu_out.move_lines.filtered(lambda m: m.product_id == prod)
- if not moves:
+ move = bu_out.move_lines.filtered(lambda m: m.product_id == prod)
+ if not move:
raise UserError(f"Move BU/OUT tidak ditemukan untuk produk {prod.display_name}")
-
- for move in moves:
- srt_return_lines.append((0, 0, {
- 'product_id': prod.id,
- 'quantity': move.product_uom_qty,
- 'move_id': move.id,
- }))
-
+ srt_return_lines.append((0, 0, {
+ 'product_id': prod.id,
+ 'quantity': qty_total,
+ '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: