[MIG] account_asset_management: Migration to v14

TT26410
This commit is contained in:
João Marques
2021-01-14 07:53:25 +00:00
committed by Rodrigo
parent 2aa11d4e40
commit dd7e4e08df
17 changed files with 203 additions and 319 deletions

View File

@@ -1,4 +1,5 @@
# Copyright 2009-2018 Noviat
# Copyright 2021 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
@@ -255,7 +256,7 @@ class AccountAssetLine(models.Model):
depreciation_date, exp_acc, "expense", move
)
self.env["account.move.line"].with_context(ctx).create(aml_e_vals)
move.post()
move.action_post()
line.with_context(allow_asset_line_update=True).write({"move_id": move.id})
created_move_ids.append(move.id)
asset_ids.add(asset.id)