[IMP] account_asset_management: prevent from creating assets from tax lines
This commit is contained in:
parent
ce0e170f1c
commit
ab9164d69b
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user