summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):