summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-11-05 14:43:55 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-11-05 14:43:55 +0700
commitcabe184a38a6a96b9557ff7debb2e9165894a7b6 (patch)
treecd6fb5637907287ea80c39268c88b87600d38c31
parent9c76d76fedc18416eeef7335534847f67fff7814 (diff)
push
-rwxr-xr-xindoteknik_custom/models/sale_order.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 1eba2808..d7b0ccee 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -2342,11 +2342,6 @@ class SaleOrder(models.Model):
# return self._create_notification_action('Notification',
# 'Terdapat invoice yang telah melewati batas waktu, mohon perbarui pada dokumen Due Extension')
- if not order.with_context(ask_approval=True)._is_request_to_own_team_leader():
- return self._create_notification_action(
- 'Peringatan',
- 'Hanya bisa konfirmasi SO tim Anda.'
- )
if order._requires_approval_margin_leader():
order.approval_status = 'pengajuan2'
return self._create_approval_notification('Pimpinan')
@@ -2362,6 +2357,12 @@ class SaleOrder(models.Model):
self.check_limit_so_to_invoice()
order.approval_status = 'pengajuan1'
return self._create_approval_notification('Team Sales')
+
+ if not order.with_context(ask_approval=True)._is_request_to_own_team_leader():
+ return self._create_notification_action(
+ 'Peringatan',
+ 'Hanya bisa konfirmasi SO tim Anda.'
+ )
raise UserError("Bisa langsung Confirm")
@@ -2716,11 +2717,12 @@ class SaleOrder(models.Model):
if user.is_leader or user.is_sales_manager:
return True
+ if self.env.context.get("ask_approval") and user.id in (3401, 20, 3988):
+ return True
+
if not self.env.context.get("ask_approval") and user.id in (3401, 20, 3988, 17340): # admin (fida, nabila, ninda)
raise UserError("Yahaha gabisa confirm so, minta ke sales nya ajah")
- if self.env.context.get("ask_approval") and user.id in (3401, 20, 3988):
- return True
salesperson_id = self.user_id.id
approver_id = user.id