Skip to content

Commit

Permalink
[FIX] account_banking_ach_discount
Browse files Browse the repository at this point in the history
  • Loading branch information
max3903 committed Mar 13, 2021
1 parent 0761bc7 commit 1f674ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
3 changes: 1 addition & 2 deletions account_banking_ach_discount/models/account_payment_order.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class AccountPaymentOrder(models.Model):
_inherit = "account.payment.order"

def _prepare_move(self, bank_lines=None):
values = super(AccountPaymentOrder, self)._prepare_move(bank_lines)
values = super()._prepare_move(bank_lines)
bank_payment_line_pool = self.env["bank.payment.line"]
line_ids = []
for vals in values.get("line_ids"):
Expand Down
11 changes: 0 additions & 11 deletions account_banking_ach_discount/models/bank_payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,3 @@ def _compute_discount_amount(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 1f674ba

Please sign in to comment.