Skip to content

Commit

Permalink
Merge pull request #863 from ursais/cb_void_check
Browse files Browse the repository at this point in the history
[UPD] advance_check_void: unreconcile bills when payment is voided
  • Loading branch information
cbeddies authored Oct 14, 2024
2 parents 51e246b + 1d0ff26 commit e916e99
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 e916e99

Please sign in to comment.