summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-11-16 14:54:10 +0100
committerDenis Ledoux <dle@odoo.com>2015-11-16 15:17:07 +0100
commit3dd79b3d65cdac2598db95a287d85442bb3bc0f4 (patch)
tree670bbe8be2a61841011711e0f6f0884bcc4125f3 /addons
parent3510ff39217cb8d73eeadbea91d0114aba03df20 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_bank_statement.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
index e81b2f8af98..20878928588 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -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']