[13.0][account_asset_management] propose account when user chooses
This commit is contained in:
parent
ffa8d96851
commit
69299744f2
@ -14,7 +14,10 @@ class AccountAssetLine(models.Model):
|
||||
|
||||
name = fields.Char(string="Depreciation Name", size=64, readonly=True)
|
||||
asset_id = fields.Many2one(
|
||||
comodel_name="account.asset", string="Asset", required=True, ondelete="cascade",
|
||||
comodel_name="account.asset",
|
||||
string="Asset",
|
||||
required=True,
|
||||
ondelete="cascade",
|
||||
check_company=True,
|
||||
)
|
||||
previous_id = fields.Many2one(
|
||||
@ -44,7 +47,9 @@ class AccountAssetLine(models.Model):
|
||||
line_date = fields.Date(string="Date", required=True)
|
||||
line_days = fields.Integer(string="Days", readonly=True)
|
||||
move_id = fields.Many2one(
|
||||
comodel_name="account.move", string="Depreciation Entry", readonly=True,
|
||||
comodel_name="account.move",
|
||||
string="Depreciation Entry",
|
||||
readonly=True,
|
||||
check_company=True,
|
||||
)
|
||||
move_check = fields.Boolean(
|
||||
@ -65,10 +70,7 @@ class AccountAssetLine(models.Model):
|
||||
"for which Odoo has not generated accounting entries.",
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
'res.company',
|
||||
store=True,
|
||||
readonly=True,
|
||||
related='asset_id.company_id',
|
||||
"res.company", store=True, readonly=True, related="asset_id.company_id",
|
||||
)
|
||||
|
||||
@api.depends("amount", "previous_id", "type")
|
||||
|
@ -80,7 +80,7 @@ class AccountAssetRemove(models.TransientModel):
|
||||
@api.model
|
||||
def _default_company_id(self):
|
||||
asset_id = self.env.context.get("active_id")
|
||||
asset = self.env['account.asset'].browse(asset_id)
|
||||
asset = self.env["account.asset"].browse(asset_id)
|
||||
return asset.company_id
|
||||
|
||||
@api.model
|
||||
|
@ -6,7 +6,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Remove Asset">
|
||||
<group colspan="4" col="4">
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="company_id" groups="base.group_multi_company" />
|
||||
<field name="date_remove" />
|
||||
<field name="force_date" />
|
||||
<field name="sale_value" />
|
||||
|
Loading…
Reference in New Issue
Block a user