mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[IMP] account_asset_management: prevent from creating assets from tax lines
This commit is contained in:
committed by
sbiosca-s73
parent
736e06857f
commit
e812bd0b1b
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user