Skip to content

Commit

Permalink
[FIX] Fixed issued of a reconcie functionlity.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmmarOfficewalaSerpentCS committed Jul 9, 2021
1 parent 1f674ba commit 49b55ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions account_banking_ach_discount/models/bank_payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,16 @@ def _compute_discount_amount(self):
for bline in self:
discount_amount = sum(bline.mapped("payment_line_ids.discount_amount"))
bline.discount_amount = discount_amount

def reconcile(self):
self.ensure_one()
amlo = self.env["account.move.line"]
transit_mlines = amlo.search([("bank_payment_line_id", "=", self.id)])
for line in transit_mlines:
ap_mlines = line.move_id.line_ids.filtered(
lambda x: x.account_id == line.account_id
)
lines_to_rec = line
lines_to_rec += ap_mlines
lines_to_rec.reconcile()

0 comments on commit 49b55ed

Please sign in to comment.