From b8824913a7f4a76d96e43b6742ff2f028969e047 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Fri, 2 Mar 2018 14:45:15 +0100 Subject: [PATCH] [FIX] account: fix _amount_residual() dependencies. The computation of residual amounts on account.move.line does not use account_id.currency_id... and should not. Never. The previous implementation was thus stupidly recomputing the amount_residual fields on all journal entries of an account as soon as its currency field was touched, for nothing. --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index fc20c5196dc..922e30a0b67 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -262,7 +262,7 @@ class AccountMoveLine(models.Model): if not cr.fetchone(): cr.execute('CREATE INDEX account_move_line_partner_id_ref_idx ON account_move_line (partner_id, ref)') - @api.depends('debit', 'credit', 'amount_currency', 'currency_id', 'matched_debit_ids', 'matched_credit_ids', 'matched_debit_ids.amount', 'matched_credit_ids.amount', 'account_id.currency_id', 'move_id.state') + @api.depends('debit', 'credit', 'amount_currency', 'currency_id', 'matched_debit_ids', 'matched_credit_ids', 'matched_debit_ids.amount', 'matched_credit_ids.amount', 'move_id.state') def _amount_residual(self): """ Computes the residual amount of a move line from a reconciliable account in the company currency and the line's currency. This amount will be 0 for fully reconciled lines or lines from a non-reconciliable account, the original line amount