From 7c7ee5d0ec3ad0857495b92fa6b99cc4fd5e894a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 23 Feb 2016 15:07:09 +0100 Subject: [PATCH] [FIX] account_asset: currency conversion inverted During the conversion of the module `account_asset` to the new API, the currency conversion in `create_move` has been inverted. ``` amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context) ``` has been converted to ``` amount = company_currency.compute(line.amount, current_currency) ``` while it should have been converted to ``` amount = current_currency.compute(line.amount, company_currency) ``` See: https://github.com/odoo/odoo/commit/6120bab#diff-e35933343c229da0afceb2a3b9e3639bR356 opw-669568 --- addons/account_asset/account_asset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index c093e86c922..eebbd041083 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -353,7 +353,7 @@ class AccountAssetDepreciationLine(models.Model): periods = self.env['account.period'].find(depreciation_date) company_currency = line.asset_id.company_id.currency_id current_currency = line.asset_id.currency_id - amount = company_currency.compute(line.amount, current_currency) + amount = current_currency.compute(line.amount, company_currency) sign = (line.asset_id.category_id.journal_id.type == 'purchase' or line.asset_id.category_id.journal_id.type == 'sale' and 1) or -1 asset_name = "/" reference = line.asset_id.name