summaryrefslogtreecommitdiff
path: root/fixco_custom/models/account_move_reversal.py
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-09 14:53:34 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-09 14:53:34 +0700
commit57dee69f10404610c9b2cac8268f78ebd92a9b19 (patch)
treea5280fb2f04cee2c4359943cb2282999ba666fe1 /fixco_custom/models/account_move_reversal.py
parentf0fdef1687cf29adb42fbb10512820088d8a9953 (diff)
parent82c1232c08894dad3d6e326649785b5669a12077 (diff)
Merge branch 'main' of https://bitbucket.org/altafixco/fixco-addons into bills_add_item_po
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 = []