summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/update_depreciation_move_wizard.py
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-02-16 10:09:01 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-02-16 10:09:01 +0700
commit7a9d6dab1578f7f2d2ea77b58c8fa4eeec4a037f (patch)
treeedb067ecc275873d9f1aaf0f9d04c5718fe76c8f /indoteknik_custom/models/update_depreciation_move_wizard.py
parentd2a64b4e6023f0768d5c326c833fd5a9d8a11444 (diff)
parentc6c01d5b7bfa1a95e0e8191a71215f76960f6b88 (diff)
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into cr_renca_find
Diffstat (limited to 'indoteknik_custom/models/update_depreciation_move_wizard.py')
-rw-r--r--indoteknik_custom/models/update_depreciation_move_wizard.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/indoteknik_custom/models/update_depreciation_move_wizard.py b/indoteknik_custom/models/update_depreciation_move_wizard.py
new file mode 100644
index 00000000..7d465f1d
--- /dev/null
+++ b/indoteknik_custom/models/update_depreciation_move_wizard.py
@@ -0,0 +1,48 @@
+from odoo import models, fields, api
+from odoo.exceptions import UserError
+
+class UpdateDepreciationMoveWizard(models.TransientModel):
+ _name = 'update.depreciation.move.wizard'
+ _description = 'Wizard untuk Update Move Check Depreciation Line'
+
+ target_date = fields.Date(string="Tanggal Depresiasi", required=True)
+
+ # def action_update_move_check(self):
+ # lines = self.env['account.asset.depreciation.line'].search([
+ # ('depreciation_date', '=', self.target_date),
+ # ])
+ # if not lines:
+ # raise UserError("Tidak ada baris depresiasi dengan tanggal tersebut.")
+
+ # updated_count = 0
+ # for line in lines:
+ # if not line.move_check:
+ # line.move_check = True
+ # line.move_posted_check = True
+ # updated_count += 1
+
+ # return {
+ # 'type': 'ir.actions.client',
+ # 'tag': 'display_notification',
+ # 'params': {
+ # 'title': 'Update Selesai',
+ # 'message': f'{updated_count} baris berhasil di-update.',
+ # 'type': 'success',
+ # 'sticky': False,
+ # }
+ # }
+
+ def action_update_move_check(self):
+ assets = self.env['account.asset.asset']
+ assets.compute_generated_entries(self.target_date)
+
+ return {
+ 'type': 'ir.actions.client',
+ 'tag': 'display_notification',
+ 'params': {
+ 'title': 'Update Selesai',
+ 'message': 'Depresiasi berhasil di-update.',
+ 'type': 'success',
+ 'sticky': False,
+ }
+ } \ No newline at end of file