From 27bbcb45ad7db802f3635b489c3fe39d2f5c7893 Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Fri, 22 Jun 2018 14:22:33 +0200 Subject: [PATCH] [FIX] account: fix traceback in payment matching when writeoff is involved, there was a traceback --- addons/account/models/account_move.py | 2 +- addons/account/models/reconciliation_widget.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d9cba8c87ba..c07bb575ced 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -912,7 +912,7 @@ class AccountMoveLine(models.Model): """ Create a writeoff move per journal for the account.move.lines in self. If debit/credit is not specified in vals, the writeoff amount will be computed as the sum of amount_residual of the given recordset. - :param writeoff_vals: dict containing values suitable for account_move_line.create(). The data in vals will + :param writeoff_vals: list of dicts containing values suitable for account_move_line.create(). The data in vals will be processed to create bot writeoff acount.move.line and their enclosing account.move. """ def compute_writeoff_counterpart_vals(values): diff --git a/addons/account/models/reconciliation_widget.py b/addons/account/models/reconciliation_widget.py index b0ce440093f..ca9513e4f39 100644 --- a/addons/account/models/reconciliation_widget.py +++ b/addons/account/models/reconciliation_widget.py @@ -743,7 +743,7 @@ class AccountReconciliation(models.AbstractModel): if writeoff_currency != company_currency: mv_line_dict['debit'] = writeoff_currency._convert(mv_line_dict['debit'], company_currency, company, date) mv_line_dict['credit'] = writeoff_currency._convert(mv_line_dict['credit'], company_currency, company, date) - writeoff_lines += account_move_line._create_writeoff(mv_line_dict) + writeoff_lines += account_move_line._create_writeoff([mv_line_dict]) (account_move_line + writeoff_lines).reconcile() else: