diff options
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 125a049b..e71e3830 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -2160,9 +2160,9 @@ 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._is_request_to_own_team_leader(): + if not order.with_context(ask_approval=True)._is_request_to_own_team_leader(): return self._create_notification_action( - 'Peringatan', + 'Peringatan', 'Hanya bisa konfirmasi SO tim Anda.' ) if order._requires_approval_margin_leader(): @@ -2531,7 +2531,7 @@ class SaleOrder(models.Model): if user.id in (3401, 20, 3988): # admin (fida, nabila, ninda) return True - if not self.team_id or not self.team_id.user_id: + if self.env.context.get("ask_approval") and user.id in (3401, 20, 3988): return True salesperson_id = self.user_id.id |
