[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 sbiosca-s73
parent 736e06857f
commit e812bd0b1b

View File

@@ -87,7 +87,9 @@ class AccountMove(models.Model):
def action_post(self):
super().action_post()
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)
if not aml.name:
raise UserError(