[FIX] account: improve performances for reconciliations

This rev. is related to 3dd79b3d65.

Both `journal_id` and `date` on `account.move.line` are
related from the `move_id` of the line.

Besides, the move associated to these move lines is
created with the same values, in
`_prepare_reconciliation_move`:
 - The move `date` is set with `self.date`,
   exactly the same than what was set in the `aml_dict`
 - The move `journal_id` is set with `self.statement_id.journal_id.id`,
   which is the origin field of the related field `self.journal_id.id`
   used in the `aml_dict`

opw-656463
This commit is contained in:
Denis Ledoux
2015-11-16 17:58:15 +01:00
parent c2a6aeb244
commit 9c5961bc8a
@@ -818,9 +818,7 @@ class AccountBankStatementLine(models.Model):
ctx = dict(self._context, date=self.date)
for aml_dict in to_create:
aml_dict['move_id'] = move.id
aml_dict['date'] = self.date
aml_dict['partner_id'] = self.partner_id.id
aml_dict['journal_id'] = self.journal_id.id
aml_dict['statement_id'] = self.statement_id.id
if st_line_currency.id != company_currency.id:
aml_dict['amount_currency'] = aml_dict['debit'] - aml_dict['credit']