diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-09-23 10:13:59 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-09-23 10:13:59 +0000 |
| commit | 480ed30cb82e82ab3748f304472aeb10da795160 (patch) | |
| tree | a056d92ea17bec8a205677ac8e8842583030c58e | |
| parent | 62f151bb1a2287d83844d5a838485b06948d531c (diff) | |
| parent | 5abefd1181a148c4caf9b5dd2082ee3b3e884751 (diff) | |
Merged in refund_system (pull request #431)
Refund system
| -rw-r--r-- | indoteknik_custom/models/refund_sale_order.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index 687acd6d..eab25452 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -902,6 +902,14 @@ class RefundSaleOrder(models.Model): for rec in self: if not is_fat: raise UserError("Hanya Finance yang dapat mengkonfirmasi pembayaran refund.") + is_journal = self.env['account.move'].search([ + ('refund_id', '=', rec.id), + ('state', '=', 'posted') + ]) + if not is_journal: + raise UserError("Journal Payment Refund belum dibuat, buat Journal Payment Refund sebelum confirm refund.") + if is_journal and rec.amount_refund != sum(is_journal.mapped('amount_total_signed')): + raise UserError("Total Refund dengan Total Journal Harus Sama.") if rec.status_payment == 'pending': rec.status_payment = 'done' rec.refund_date = fields.Date.context_today(self) |
