summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2026-03-02 09:26:58 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2026-03-02 09:26:58 +0700
commitbead198bddde8da4f7f67dcc5429e0ed51bfccfe (patch)
treec0d66bcc8296675cfa374bd392268da4a6694007
parentc229cfa774e9283938102c4b2ccc41756014842a (diff)
push
-rw-r--r--indoteknik_custom/models/account_asset.py10
1 files changed, 9 insertions, 1 deletions
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):