summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-07-09 10:16:19 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-07-09 10:16:19 +0700
commitaedf25e194d4ddddab9b158b473164151109edaf (patch)
tree6e92cfd66822628a89d71b9e65f30a8239a12af9 /indoteknik_custom/models
parent21128e0f165045558c2c8ef6faf199d4379614b1 (diff)
<miqdad> rev 77 vals bu input
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/tukar_guling_po.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py
index e9dfda33..aa8fd1f3 100644
--- a/indoteknik_custom/models/tukar_guling_po.py
+++ b/indoteknik_custom/models/tukar_guling_po.py
@@ -239,6 +239,13 @@ class TukarGulingPO(models.Model):
def write(self, vals):
self._check_bill_on_revisi_po()
+ tipe = vals.get('return_type', self.return_type)
+
+
+ if self.operations.picking_type_id.id == 28 and tipe == 'tukar_guling':
+ raise UserError("❌ BU/INPUT tidak boleh di retur tukar guling")
+
+
if self.operations.picking_type_id.id != 28:
if self._is_already_returned(self.operations):
raise UserError("BU ini sudah pernah diretur oleh dokumen lain.")