summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-10-07 15:08:17 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-10-07 15:08:17 +0700
commit3c7176c6d87c4a1385e5a87e119878b6e9a5d88f (patch)
tree72c2a6c4eea68117f41df446aa8aae6352c2b8ea
parentd68f2b567b82898afe8f975cabc598d364c24f2c (diff)
<Miqdad> add more vals IU approval
-rw-r--r--indoteknik_custom/models/stock_picking.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index a2bd7339..51b6276c 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1340,11 +1340,14 @@ class StockPicking(models.Model):
raise UserError(_('Tidak bisa Validate jika tidak dari Document SO / PO'))
# 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")
+ # 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:
+ 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:
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:
+ raise UserError("Harus di Approve oleh Accounting")
+
if self.picking_type_id.id == 28 and not self.env.user.is_logistic_approver:
raise UserError("Harus di Approve oleh Logistik")
@@ -1353,7 +1356,7 @@ 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]:
+ 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'