summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-07-15 11:59:36 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-07-15 11:59:36 +0700
commit85caa56671d90cde807c44179680ef790d1a58c5 (patch)
treecd7d6ab4df5b42a43b298722d200bd0269502b35
parent4f8f59f274e8ea19fcaa5f1c6b0e6e30400c66f7 (diff)
<miqdad> tukar guling po vals rev
-rw-r--r--indoteknik_custom/models/tukar_guling_po.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py
index 6d7d7335..3292eb7d 100644
--- a/indoteknik_custom/models/tukar_guling_po.py
+++ b/indoteknik_custom/models/tukar_guling_po.py
@@ -311,7 +311,7 @@ class TukarGulingPO(models.Model):
self._validate_product_lines()
self._check_not_allow_tukar_guling_on_bu_input()
- if self.operations and self.operations.picking_type_id.id == 28 and self.return_type == 'tukar_guling':
+ if self.operations.picking_type_id.id == 28:
group = self.operations.group_id
if group:
# Cari BU/PUT dalam group yang sama
@@ -325,11 +325,12 @@ class TukarGulingPO(models.Model):
raise UserError("❌ Tidak bisa retur BU/INPUT karena BU/PUT sudah Done!")
picking = self.operations
- if picking.picking_type_id.id == 75:
+ pick_id = self.operations.picking_type_id.id
+ if pick_id == 75:
if picking.state != 'done':
raise UserError("BU/PUT belum Done!")
- if picking.picking_type_id.id != 75 or picking.picking_type_id.id != 28:
+ if pick_id not in [75, 28]:
raise UserError("❌ Tidak bisa retur bukan BU/INPUT atau BU/PUT!")
if self._is_already_returned(self.operations):