summaryrefslogtreecommitdiff
path: root/fixco_custom/models/account_move_reversal.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2026-01-09 13:03:09 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2026-01-09 13:03:09 +0700
commit82c1232c08894dad3d6e326649785b5669a12077 (patch)
treea4f479052a9d59a58719e73b2b9ef4443e98bd05 /fixco_custom/models/account_move_reversal.py
parent4db2619225eea1edb72da972ba2b829008e40f30 (diff)
push
Diffstat (limited to 'fixco_custom/models/account_move_reversal.py')
-rw-r--r--fixco_custom/models/account_move_reversal.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/fixco_custom/models/account_move_reversal.py b/fixco_custom/models/account_move_reversal.py
index eac8660..2645645 100644
--- a/fixco_custom/models/account_move_reversal.py
+++ b/fixco_custom/models/account_move_reversal.py
@@ -11,8 +11,13 @@ class AccountMoveReversal(models.TransientModel):
self.ensure_one()
moves = self.move_ids
- if moves.move_type == 'entry' and moves.sale_id and moves.ref.startswith('UANG MUKA PENJUALAN') and self.env.user.id not in [9, 10, 15]:
- raise UserError(_('Anda tidak memiliki akses untuk melakukan reverse Uang Muka Penjualan!'))
+ if moves.move_type == 'entry' and moves.sale_id and moves.ref.startswith('UANG MUKA PENJUALAN'):
+ if not moves.approval_refund:
+ raise UserError(_('User harus ajukan approval refund!'))
+ if moves.approval_refund == 'rejected':
+ raise UserError(_('refund telah ditolak!'))
+
+ moves.approval_refund = 'approved'
# Create default values.
default_values_list = []