summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/refund_sale_order.py
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-09-23 17:27:24 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-09-23 17:27:24 +0700
commita9c6b59debbde9053b517f98402a9414779f75ce (patch)
tree94d0f8a59c50415f5296f28d677c3136496e1e8d /indoteknik_custom/models/refund_sale_order.py
parent7d09b515d62c9578301d3365d441958889aedc0f (diff)
parent25f0261dac43b55d674193bd00fbadcad2706c08 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
merge
Diffstat (limited to 'indoteknik_custom/models/refund_sale_order.py')
-rw-r--r--indoteknik_custom/models/refund_sale_order.py8
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)