From 1f674ba246491971cbad010dd13d451311a9a981 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Sat, 13 Mar 2021 03:56:03 -0600 Subject: [PATCH] [FIX] account_banking_ach_discount --- .../models/account_payment_order.py | 3 +-- .../models/bank_payment_line.py | 11 ----------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/account_banking_ach_discount/models/account_payment_order.py b/account_banking_ach_discount/models/account_payment_order.py index 10a96b10..d90b051c 100644 --- a/account_banking_ach_discount/models/account_payment_order.py +++ b/account_banking_ach_discount/models/account_payment_order.py @@ -1,6 +1,5 @@ # Copyright (C) 2019 Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - from odoo import models @@ -8,7 +7,7 @@ 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"): diff --git a/account_banking_ach_discount/models/bank_payment_line.py b/account_banking_ach_discount/models/bank_payment_line.py index d2e8f2ce..222c6734 100644 --- a/account_banking_ach_discount/models/bank_payment_line.py +++ b/account_banking_ach_discount/models/bank_payment_line.py @@ -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()