2
0

[14.0][FIX] account_asset_management: pre-commit

This commit is contained in:
ps-tubtim 2021-07-21 11:28:38 +07:00 committed by Rodrigo
parent 69299744f2
commit 6d49df0ddf
2 changed files with 9 additions and 3 deletions

View File

@ -70,7 +70,10 @@ class AccountAssetLine(models.Model):
"for which Odoo has not generated accounting entries.", "for which Odoo has not generated accounting entries.",
) )
company_id = fields.Many2one( 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") @api.depends("amount", "previous_id", "type")

View File

@ -152,10 +152,13 @@ class AccountMoveLine(models.Model):
_inherit = "account.move.line" _inherit = "account.move.line"
asset_profile_id = fields.Many2one( asset_profile_id = fields.Many2one(
comodel_name="account.asset.profile", string="Asset Profile", comodel_name="account.asset.profile",
string="Asset Profile",
) )
asset_id = fields.Many2one( asset_id = fields.Many2one(
comodel_name="account.asset", string="Asset", ondelete="restrict", comodel_name="account.asset",
string="Asset",
ondelete="restrict",
) )
@api.onchange("account_id") @api.onchange("account_id")