Merge PR #1038 into 13.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2020-08-07 14:53:40 +00:00
2 changed files with 6 additions and 2 deletions

View File

@@ -123,7 +123,11 @@ class AccountAssetLine(models.Model):
)
elif list(vals.keys()) == ["asset_id"]:
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(
_(
"You cannot change a depreciation line "

View File

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