From 0d332ba006084ca69ed3d5944254c06350bca24a Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Wed, 14 Apr 2021 14:51:00 +0200 Subject: [PATCH] [13.0][account_asset_management]: add user error when creating asset from bill --- account_asset_management/models/account_move.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/account_asset_management/models/account_move.py b/account_asset_management/models/account_move.py index 508ad9aa..caa50e13 100644 --- a/account_asset_management/models/account_move.py +++ b/account_asset_management/models/account_move.py @@ -65,6 +65,10 @@ class AccountMove(models.Model): for move in self: for aml in move.line_ids.filtered("asset_profile_id"): depreciation_base = aml.price_subtotal + if not aml.name: + raise UserError( + _("Asset name must be set in the label of the line.") + ) vals = { "name": aml.name, "code": move.name,