From 26938da071e77b853d09d512b4812dd2ba645afb Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Wed, 29 Mar 2017 11:56:42 +0200 Subject: [PATCH] [FIX] account: fix statement_line_id on bank statement processing. Since ee2c76a43111acdf9b1ccfc132d1a8a97912e55d, a new field 'statement_line_id' has been added on account.move.line object and the field 'statement_id' became a related... but this statement_line_id on the bank account aml was, by mistake, not set. That created aml that were wrongly appearing in blue in the reconciliation widget. If this error occured in a DB, the following SQL query can fix it: $ UPDATE account_move_line l SET statement_line_id = s.id FROM account_bank_statement_line s WHERE l.statement_line_id IS NULL AND l.statement_id = s.statement_id AND l.name = s.name AND coalesce(s.partner_id, 0) = coalesce(l.partner_id, 0); --- addons/account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 0915e4c9f90..8f685a80b66 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -787,7 +787,7 @@ class AccountBankStatementLine(models.Model): or self.statement_id.journal_id.default_debit_account_id.id, 'credit': amount < 0 and -amount or 0.0, 'debit': amount > 0 and amount or 0.0, - 'statement_id': self.statement_id.id, + 'statement_line_id': self.id, 'currency_id': statement_currency != company_currency and statement_currency.id or (st_line_currency != company_currency and st_line_currency.id or False), 'amount_currency': amount_currency, }