diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-08-05 17:10:21 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-08-05 17:10:21 +0700 |
| commit | d1a529a1cb034086b0581b110c48785e28bf3a8c (patch) | |
| tree | 8f8191dab611983bc16c6db852592acba5cdf7a8 /indoteknik_custom/models | |
| parent | 216fe79c11dace298b260be946f14a3af5b5a929 (diff) | |
(andri) add validasi confirm payment only AP
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/down_payment.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 1fbac44a..ab30337a 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -318,12 +318,26 @@ class DownPayment(models.Model): def action_confirm_payment(self): + ap_user_ids = [23, 9468] + if self.env.user.id not in ap_user_ids: + raise UserError('Hanya User AP yang dapat menggunakan fitur ini.') + for rec in self: if not rec.attachment_file_image and not rec.attachment_file_pdf: - raise UserError('Tidak bisa konfirmasi pembayaran karena belum ada bukti attachment (PDF/Image).') - + raise UserError( + f'Tidak bisa konfirmasi pembayaran PUM {rec.name or ""} ' + f'karena belum ada bukti attachment (PDF/Image).' + ) + rec.status_pay_down_payment = 'payment' + rec.message_post( + body="Status pembayaran telah <b>dikonfirmasi</b> oleh <b>AP</b>.", + message_type="comment", + subtype_xmlid="mail.mt_note", + ) + + # def action_approval_check(self): # for record in self: |
