[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
This commit is contained in:
Nicolas Martinelli
2016-05-19 11:16:55 +02:00
parent c286e2d5b2
commit 9365482df0
@@ -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)