From 1d0ff26de24fea6d4f76e3a1a194ed2fddd944a0 Mon Sep 17 00:00:00 2001 From: cbeddies Date: Tue, 10 Sep 2024 13:07:59 -0400 Subject: [PATCH] [UPD] advance_check_void: unreconcile bills when payment is voided --- advance_check_void/wizard/simple_void_check.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advance_check_void/wizard/simple_void_check.py b/advance_check_void/wizard/simple_void_check.py index 2490876be..28c441d2a 100644 --- a/advance_check_void/wizard/simple_void_check.py +++ b/advance_check_void/wizard/simple_void_check.py @@ -15,6 +15,7 @@ def simple_void_check(self): """Void Check.................""" payment_check_void_obj = self.env["payment.check.void"] check_hist_obj = self.env["payment.check.history"] + account_move_obj = self.env["account.move"] payment_check_void_obj.create( { "bill_ref": self.payment_id.ref, @@ -37,3 +38,6 @@ def simple_void_check(self): if check_ids: check_ids.write({"state": "posted"}) self.payment_id.action_unmark_sent() + partial_reconciled_line_ids = self.env["account.partial.reconcile"].search(["|", ("id", "in", self.payment_id.reconciled_bill_ids.line_ids.matched_debit_ids.ids), ("id", "in", self.payment_id.reconciled_bill_ids.line_ids.matched_credit_ids.ids)]) + for partial_id in partial_reconciled_line_ids: + account_move_obj.sudo().js_remove_outstanding_partial(partial_id.id)