summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-02-23 15:14:58 +0100
committerDenis Ledoux <dle@odoo.com>2016-02-23 15:19:48 +0100
commit8a098df7e6a9867d25faeee4e7ae4e29a9b9a613 (patch)
tree5c7d51fa3b35e5c602a735a154319cd6c208e05c
parent7c7ee5d0ec3ad0857495b92fa6b99cc4fd5e894a (diff)
[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
-rw-r--r--addons/account_asset/account_asset.py4
1 files 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,