diff --git a/account_asset_management/models/account_asset.py b/account_asset_management/models/account_asset.py
index d1e0b476..44c69a26 100644
--- a/account_asset_management/models/account_asset.py
+++ b/account_asset_management/models/account_asset.py
@@ -61,14 +61,12 @@ class AccountAsset(models.Model):
purchase_value = fields.Monetary(
required=True,
states=READONLY_STATES,
- currency_field="company_currency_id",
help="This amount represent the initial value of the asset."
"\nThe Depreciation Base is calculated as follows:"
"\nPurchase Value - Salvage Value.",
)
salvage_value = fields.Monetary(
states=READONLY_STATES,
- currency_field="company_currency_id",
help="The estimated value that an asset will realize upon "
"its sale at the end of its useful life.\n"
"This value is used to determine the depreciation amounts.",
@@ -76,20 +74,17 @@ class AccountAsset(models.Model):
depreciation_base = fields.Monetary(
compute="_compute_depreciation_base",
store=True,
- currency_field="company_currency_id",
help="This amount represent the depreciation base "
"of the asset (Purchase Value - Salvage Value).",
)
value_residual = fields.Monetary(
compute="_compute_depreciation",
string="Residual Value",
- currency_field="company_currency_id",
store=True,
)
value_depreciated = fields.Monetary(
compute="_compute_depreciation",
string="Depreciated Value",
- currency_field="company_currency_id",
store=True,
)
note = fields.Text()
@@ -262,7 +257,7 @@ class AccountAsset(models.Model):
readonly=True,
default=lambda self: self._default_company_id(),
)
- company_currency_id = fields.Many2one(
+ currency_id = fields.Many2one(
comodel_name="res.currency",
related="company_id.currency_id",
string="Company Currency",
@@ -514,7 +509,7 @@ class AccountAsset(models.Model):
def validate(self):
for asset in self:
- if asset.company_currency_id.is_zero(asset.value_residual):
+ if asset.currency_id.is_zero(asset.value_residual):
asset.state = "close"
else:
asset.state = "open"
diff --git a/account_asset_management/models/account_asset_line.py b/account_asset_management/models/account_asset_line.py
index 1c1d971f..9f81a0b7 100644
--- a/account_asset_management/models/account_asset_line.py
+++ b/account_asset_management/models/account_asset_line.py
@@ -33,20 +33,17 @@ class AccountAssetLine(models.Model):
depreciation_base = fields.Monetary(
related="asset_id.depreciation_base",
string="Depreciation Base",
- currency_field="company_currency_id",
)
- amount = fields.Monetary(required=True, currency_field="company_currency_id")
+ amount = fields.Monetary(required=True)
remaining_value = fields.Monetary(
compute="_compute_values",
string="Next Period Depreciation",
store=True,
- currency_field="company_currency_id",
)
depreciated_value = fields.Monetary(
compute="_compute_values",
string="Amount Already Depreciated",
store=True,
- currency_field="company_currency_id",
)
line_date = fields.Date(string="Date", required=True)
line_days = fields.Integer(string="Days", readonly=True)
@@ -74,7 +71,7 @@ class AccountAssetLine(models.Model):
"for which Odoo has not generated accounting entries.",
)
company_id = fields.Many2one(related="asset_id.company_id", store=True)
- company_currency_id = fields.Many2one(
+ currency_id = fields.Many2one(
related="asset_id.company_id.currency_id", store=True, string="Company Currency"
)
@@ -281,7 +278,7 @@ class AccountAssetLine(models.Model):
asset_ids.add(asset.id)
# we re-evaluate the assets to determine if we can close them
for asset in self.env["account.asset"].browse(list(asset_ids)):
- if asset.company_currency_id.is_zero(asset.value_residual):
+ if asset.currency_id.is_zero(asset.value_residual):
asset.state = "close"
return created_move_ids
diff --git a/account_asset_management/views/account_asset.xml b/account_asset_management/views/account_asset.xml
index 678e56f2..3b47bf9f 100644
--- a/account_asset_management/views/account_asset.xml
+++ b/account_asset_management/views/account_asset.xml
@@ -66,7 +66,7 @@
groups="base.group_multi_company"
/>
@@ -174,7 +174,7 @@
-
+
-
+
-
+
diff --git a/account_asset_management/wizard/account_asset_remove.py b/account_asset_management/wizard/account_asset_remove.py
index 31380aa4..e49996c4 100644
--- a/account_asset_management/wizard/account_asset_remove.py
+++ b/account_asset_management/wizard/account_asset_remove.py
@@ -24,7 +24,7 @@ class AccountAssetRemove(models.TransientModel):
required=True,
default=lambda self: self._default_company_id(),
)
- company_currency_id = fields.Many2one(
+ currency_id = fields.Many2one(
related="company_id.currency_id", string="Company Currency"
)
date_remove = fields.Date(
@@ -37,7 +37,6 @@ class AccountAssetRemove(models.TransientModel):
force_date = fields.Date(string="Force accounting date")
sale_value = fields.Monetary(
default=lambda self: self._default_sale_value(),
- currency_field="company_currency_id",
)
account_sale_id = fields.Many2one(
comodel_name="account.account",
@@ -107,7 +106,7 @@ class AccountAssetRemove(models.TransientModel):
)
for line in inv_lines:
inv = line.move_id
- comp_curr = inv.company_currency_id
+ comp_curr = inv.currency_id
inv_curr = inv.currency_id
if line.move_id.payment_state == "paid" or line.parent_state == "draft":
account_sale_id = line.account_id.id