From 9365482df05f49fda86735343013163871cd33e0 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 19 May 2016 08:55:39 +0200 Subject: [PATCH] [FIX] account: sequence of statement The sequence used in the bank statement lines is not reliable. Indeed, several lines might have the same sequence. opw-676924 --- addons/account/models/account_bank_statement.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index c77240b482d..e518964d7f2 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -815,6 +815,7 @@ class AccountBankStatementLine(models.Model): st_line_currency_rate = self.currency_id and (self.amount_currency / self.amount) or False # Create the move + self.sequence = self.statement_id.line_ids.ids.index(self.id) + 1 move_name = (self.statement_id.name or self.name) + "/" + str(self.sequence) move_vals = self._prepare_reconciliation_move(move_name) move = self.env['account.move'].create(move_vals)