From d6f012ba46585349b2ab01a8b08c34618d576387 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 23 Mar 2017 13:33:24 +0100 Subject: [PATCH] [FIX] reconcile correct items --- ...atement_import_auto_reconcile_exact_amount.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/account_bank_statement_import_auto_reconcile/models/account_bank_statement_import_auto_reconcile_exact_amount.py b/account_bank_statement_import_auto_reconcile/models/account_bank_statement_import_auto_reconcile_exact_amount.py index 37799f8..c1918be 100644 --- a/account_bank_statement_import_auto_reconcile/models/account_bank_statement_import_auto_reconcile_exact_amount.py +++ b/account_bank_statement_import_auto_reconcile/models/account_bank_statement_import_auto_reconcile_exact_amount.py @@ -27,5 +27,19 @@ class AccountBankStatementImportAutoReconcileExactAmount(models.AbstractModel): precision_digits=digits ) == 0 ): - statement_line.process_reconciliation(matches) + move = self.env['account.move'].create( + self.env['account.bank.statement']._prepare_move( + statement_line, + ( + statement_line.statement_id.name or statement_line.name + ) + "/" + str(statement_line.sequence or '') + ) + ) + move_line_dict = self.env['account.bank.statement']\ + ._prepare_bank_move_line( + statement_line, move.id, -statement_line.amount, + statement_line.statement_id.company_id.currency_id.id, + ) + move_line_dict['counterpart_move_line_id'] = matches[0]['id'] + statement_line.process_reconciliation([move_line_dict]) return True