[FIX] account: improve performances for reconciliations

The field `company_id` on `account.move.line`
is a related to the `company_id` field of the
`account_id` field on this move line.

Therefore:
 - Forcing the company of the `account.move.line` to the
   company of the `account.bank.statement.line` is pointless,
   as this field is supposed to be a related from the `account_id`
   of the move line. It's the `account_id` that must be set correctly,
   to an `account.account` of the right company. This is the case, btw.
 - Forcing the company of the `account.move.line` triggers the
   write of the `company_id` on the related `account.account`, which
   triggers the write of the `company_id` on all `account.move.line`
   records having as `account_id` this `account.account`.

Therefore, the more you had move lines on an `account.account`,
the more the reconciliation was slow for move lines with this `account_id`.

opw-656463
This commit is contained in:
Denis Ledoux
2015-11-16 15:17:07 +01:00
parent 3510ff3921
commit 3dd79b3d65
@@ -821,7 +821,6 @@ class AccountBankStatementLine(models.Model):
aml_dict['date'] = self.date
aml_dict['partner_id'] = self.partner_id.id
aml_dict['journal_id'] = self.journal_id.id
aml_dict['company_id'] = self.company_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']