[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
This commit is contained in:
Denis Ledoux
2016-02-23 15:19:48 +01:00
parent 7c7ee5d0ec
commit 8a098df7e6
+2 -2
View File
@@ -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,