2
0

[FIX] account_asset_management - Allow editing salvage value

This commit is contained in:
Saran440 2020-08-06 17:33:27 +07:00 committed by Rodrigo
parent 71006a184e
commit 869cc39d5e
3 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@
{ {
"name": "Assets Management", "name": "Assets Management",
"version": "13.0.1.2.0", "version": "13.0.1.2.1",
"license": "AGPL-3", "license": "AGPL-3",
"depends": ["account"], "depends": ["account"],
"excludes": ["account_asset"], "excludes": ["account_asset"],

View File

@ -123,7 +123,11 @@ class AccountAssetLine(models.Model):
) )
elif list(vals.keys()) == ["asset_id"]: elif list(vals.keys()) == ["asset_id"]:
continue continue
elif dl.move_id and not self.env.context.get("allow_asset_line_update"): elif (
dl.move_id
and not self.env.context.get("allow_asset_line_update")
and dl.type != "create"
):
raise UserError( raise UserError(
_( _(
"You cannot change a depreciation line " "You cannot change a depreciation line "

View File

@ -100,7 +100,7 @@
name="salvage_value" name="salvage_value"
widget="monetary" widget="monetary"
options="{'currency_field': 'company_currency_id'}" options="{'currency_field': 'company_currency_id'}"
attrs="{'readonly': ['|', ('move_line_check', '=', True), ('state', '!=', 'draft')]}" attrs="{'readonly': [('state', '!=', 'draft')]}"
/> />
<field name="date_remove" /> <field name="date_remove" />
</group> </group>