summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-10-07 15:20:29 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-10-07 15:20:29 +0700
commit92d28be458ca53c9994a175225232b24c7fde283 (patch)
tree7624aa3a0d7cd1f89ee0453d0800dfe79a3c1f5a
parent5eae0547389f471c946d7713c719bb792b81dbf7 (diff)
<Miqdad> fix approval IU
-rw-r--r--indoteknik_custom/models/stock_picking.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 51b6276c..4772c433 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1342,7 +1342,10 @@ class StockPicking(models.Model):
# if self.is_internal_use and not self.env.user.is_logistic_approver and self.location_id.id == 57 and self.approval_status == 'pengajuan2':
# raise UserError("Harus di Approve oleh Logistik")
- if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan1', 'pengajuan2'] and self.location_id.id == 57 and self.is_bu_iu == True and 'BU/IU' in self.name:
+ if self.is_internal_use and self.approval_status in ['pengajuan1', '', False] and 'BU/IU' in self.name and self.is_bu_iu == True:
+ raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu")
+
+ if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan2'] and self.is_bu_iu == True and 'BU/IU' in self.name:
raise UserError("Harus di Approve oleh Logistik")
if self.is_internal_use and not self.env.user.is_accounting and self.approval_status in ['pengajuan1', '', False] and self.is_bu_iu == False:
@@ -1356,8 +1359,6 @@ class StockPicking(models.Model):
if self.is_internal_use and self.approval_status == 'pengajuan2':
self.approval_status = 'approved'
- elif self.is_internal_use and self.approval_status in ['pengajuan1', '', False] and 'BU/IU' in self.name and self.is_bu_iu == True:
- raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu")
elif self.picking_type_id.code == 'incoming':
self.approval_receipt_status = 'approved'