From 020ae64f167fa8fa724c54f79b8cae9ff8a648c0 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 19 Feb 2016 13:47:10 +0100 Subject: [PATCH 1/3] [FIX] website_portal: currency rounding for "My Orders" t-field handles better the currency rounding than t-esc. When setting the currency rounding to 0.05 instead of 0.01 (e.g. Switzerland), for 600.00: - t-esc returns 600.0 - t-field returns 600.00, as expected. opw-669945 --- addons/website_portal/views/templates.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_portal/views/templates.xml b/addons/website_portal/views/templates.xml index 10bb634b189..e3ba5741618 100644 --- a/addons/website_portal/views/templates.xml +++ b/addons/website_portal/views/templates.xml @@ -77,7 +77,7 @@ Expired - + @@ -120,7 +120,7 @@ Done - + From 7c7ee5d0ec3ad0857495b92fa6b99cc4fd5e894a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 23 Feb 2016 15:07:09 +0100 Subject: [PATCH 2/3] [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 From 8a098df7e6a9867d25faeee4e7ae4e29a9b9a613 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 23 Feb 2016 15:14:58 +0100 Subject: [PATCH 3/3] [FIX] account_asset: can't adapt browse record to id During the conversion of the module `account_asset` to the new API, in revision 6120bab, the variables `current_currency` & `company_currency` have been changed from identifier integers to browse records. The currency passed in the `create` method values must therefore be adapted according to this change. This prevented the correct use of the assets when the currency of the assets was not the same as the currency of the company. opw-669571 --- addons/account_asset/account_asset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index eebbd041083..35d4228c71c 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -380,7 +380,7 @@ class AccountAssetDepreciationLine(models.Model): 'period_id': periods.id or False, 'journal_id': journal_id, 'partner_id': partner_id, - 'currency_id': company_currency != current_currency and current_currency or False, + 'currency_id': company_currency != current_currency and current_currency.id or False, 'amount_currency': company_currency != current_currency and - sign * line.amount or 0.0, 'analytic_account_id': line.asset_id.category_id.account_analytic_id.id if categ_type == 'sale' else False, 'date': depreciation_date, @@ -396,7 +396,7 @@ class AccountAssetDepreciationLine(models.Model): 'period_id': periods.id or False, 'journal_id': journal_id, 'partner_id': partner_id, - 'currency_id': company_currency != current_currency and current_currency or False, + 'currency_id': company_currency != current_currency and current_currency.id or False, 'amount_currency': company_currency != current_currency and sign * line.amount or 0.0, 'analytic_account_id': line.asset_id.category_id.account_analytic_id.id if categ_type == 'purchase' else False, 'date': depreciation_date,