Skip to content

Commit

Permalink
[UPD] advance_check_void: unreconcile bills when payment is voided
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeddies committed Sep 10, 2024
1 parent 51e246b commit 1d0ff26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions advance_check_void/wizard/simple_void_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)

0 comments on commit 1d0ff26

Please sign in to comment.