2
0

[IMP] account_asset_management: prevent from creating assets from tax lines

This commit is contained in:
mariadforgeflow 2022-04-01 09:15:10 +02:00 committed by Rodrigo
parent ce0e170f1c
commit ab9164d69b

View File

@ -87,7 +87,9 @@ class AccountMove(models.Model):
def action_post(self): def action_post(self):
super().action_post() super().action_post()
for move in self: for move in self:
for aml in move.line_ids.filtered("asset_profile_id"): for aml in move.line_ids.filtered(
lambda line: line.asset_profile_id and not line.tax_line_id
):
vals = move._prepare_asset_vals(aml) vals = move._prepare_asset_vals(aml)
if not aml.name: if not aml.name:
raise UserError( raise UserError(