From bead198bddde8da4f7f67dcc5429e0ed51bfccfe Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 2 Mar 2026 09:26:58 +0700 Subject: push --- indoteknik_custom/models/account_asset.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/account_asset.py b/indoteknik_custom/models/account_asset.py index c54f1d97..dbcb6ba4 100644 --- a/indoteknik_custom/models/account_asset.py +++ b/indoteknik_custom/models/account_asset.py @@ -1,5 +1,7 @@ from odoo import fields, models, api, _ from odoo.exceptions import AccessError, UserError, ValidationError +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF +from odoo.tools import float_compare, float_is_zero class AccountAsset(models.Model): @@ -15,6 +17,10 @@ class AccountAsset(models.Model): raise UserError("Asset masih mempunyai Value") asset.state = 'close' + +class AccountAssetDepreciationLine(models.Model): + _inherit = 'account.asset.depreciation.line' + def create_move(self, post_move=True): created_moves = self.env['account.move'] prec = self.env['decimal.precision'].precision_get('Account') @@ -74,7 +80,9 @@ class AccountAsset(models.Model): created_moves.filtered(lambda m: any( m.asset_depreciation_ids.mapped( 'asset_id.category_id.open_asset'))).post() - created_moves.action_post() + + for move in created_moves: + move.action_post() return [x.id for x in created_moves] def create_grouped_move(self, post_move=True): -- cgit v1.2.3