From 758db1e691ca9193ce5029246c98e3b27be540f6 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Thu, 24 Jul 2025 13:19:04 +0700 Subject: (andri) add user again for validation & rev Seq No Dokumen --- indoteknik_custom/models/down_payment.py | 12 +++++++++--- indoteknik_custom/views/ir_sequence.xml | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 8f449566..0263937b 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -238,7 +238,8 @@ class DownPayment(models.Model): ) elif rec.status == 'pengajuan2': - if self.env.user.id != 23: # ID user AP + ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + if self.env.user.id not in ap_user_ids: raise UserError("Hanya AP yang berhak menyetujui tahap ini.") rec.name_approval_ap = self.env.user.name rec.date_approved_ap = now @@ -308,7 +309,8 @@ class DownPayment(models.Model): def action_ap_only(self): - # if self.env.user.id != 23: + # ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + # if self.env.user.id not in ap_user_ids: # raise UserError('Hanya User AP yang dapat menggunakan ini.') return { 'name': 'Create CAB AP Only', @@ -542,6 +544,9 @@ class RealizationDownPayment(models.Model): self.message_post(body=f"Status realisasi diperbarui menjadi {dict(self._fields['done_status'].selection).get(self.done_status)} oleh {self.env.user.name}.") def action_cab(self): + # ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + # if self.env.user.id not in ap_user_ids: + # raise UserError('Hanya User AP yang dapat menggunakan ini.') self.ensure_one() if not self.pum_id or not self.pum_id.move_id: @@ -658,7 +663,8 @@ class RealizationDownPayment(models.Model): ) elif rec.status == 'pengajuan2': - if self.env.user.id != 23: # ID user AP + ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + if self.env.user.id not in ap_user_ids: raise UserError("Hanya AP yang berhak menyetujui tahap ini.") rec.name_approval_ap = self.env.user.name rec.date_approved_ap = now diff --git a/indoteknik_custom/views/ir_sequence.xml b/indoteknik_custom/views/ir_sequence.xml index 453a73e8..8c054fed 100644 --- a/indoteknik_custom/views/ir_sequence.xml +++ b/indoteknik_custom/views/ir_sequence.xml @@ -204,7 +204,7 @@ Down Payment Sequence down.payment - PUM/%(year)s/ + PUM/%(year)s/%(month)s/ 5 1 1 @@ -219,5 +219,6 @@ 1 1 True + \ No newline at end of file -- cgit v1.2.3