From 6ff3a1abae7c0d9db659991811b69d4ad66effb8 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 3 Mar 2026 13:37:56 +0700 Subject: (andri) edit date accounting pada journal entries sekaligus via tree --- indoteknik_custom/models/account_move.py | 46 ++++++++++++++++++++++++++ indoteknik_custom/security/ir.model.access.csv | 2 ++ indoteknik_custom/views/account_move.xml | 42 +++++++++++++++++++++++ 3 files changed, 90 insertions(+) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index a317dccc..914a5329 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -786,6 +786,24 @@ class AccountMove(models.Model): if rec.statement_line_id and not rec.statement_line_id.statement_id.is_edit and rec.statement_line_id.statement_id.state == 'confirm': raise UserError('Bank Statement di Lock, Minta admin reconcile untuk unlock') return res + + def action_open_change_date_wizard(self): + if not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa Reset to Draft') + non_draft = self.filtered(lambda m: m.state != 'draft') + if non_draft: + raise UserError('Hanya invoice dengan status draft yang bisa diubah tanggalnya. Mohon reset ke draft terlebih dahulu.') + return{ + 'name': 'Change Date Journal Entry', + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'account.move.change.date.wizard', + 'target': 'new', + 'context':{ + 'active_ids': self.ids, + 'active_model': self._name, + } + } def action_post(self): if self._name != 'account.move': @@ -997,3 +1015,31 @@ class SyncPromiseDateWizardLine(models.TransientModel): date_terima_tukar_faktur = fields.Date(related="invoice_id.date_terima_tukar_faktur", string="Tanggal Terima Tukar Faktur", readonly=True) amount_total = fields.Monetary(related="invoice_id.amount_total", string="Total", readonly=True) currency_id = fields.Many2one(related="invoice_id.currency_id", readonly=True) + +class AccountMoveChangeDateWizard(models.TransientModel): + _name = "account.move.change.date.wizard" + _description = "Account Move Change Date Wizard" + + # move_id = fields.Many2one('account.move', string="Journal Entry", required=True) + new_date = fields.Date(string="New Date", required=True) + + def action_change_date(self): + if not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa ubah tanggal') + + active_ids = self.env.context.get('active_ids', []) + moves = self.env['account.move'].browse(active_ids) + + if not moves: + raise UserError("Tidak ada journal entry yang dipilih.") + + non_draft_moves = moves.filtered(lambda m: m.state != 'draft') + if non_draft_moves: + raise UserError("Hanya journal entry dengan status 'Draft' yang dapat diubah tanggalnya.") + + for move in moves: + move.write({'date': self.new_date}) + move.message_post(body="Tanggal berhasil diubah") + + return {'type': 'ir.actions.act_window_close'} + \ No newline at end of file diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 42c68e80..041634fc 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -222,3 +222,5 @@ access_update_depreciation_move_wizard,access.update.depreciation.move.wizard,mo access_keywords,keywords,model_keywords,base.group_user,1,1,1,1 access_token_log,access.token.log,model_token_log,,1,1,1,1 + +access_account_move_change_date_wizard,access.account.move.change.date.wizard,model_account_move_change_date_wizard,,1,1,1,1 diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index c5f9580c..4b9f5316 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -218,6 +218,48 @@ action = records.export_faktur_to_xml() + + Set to Draft + + + code + action = records.button_draft() + + + + + + Change Date + + + code + action = records.action_open_change_date_wizard() + + + + account.move.change.date.wizard.form + account.move.change.date.wizard + +
+

Ubah tanggal journal yang dipilih, pastikan untuk memeriksa kembali tanggal yang akan diubah sebelum mengkonfirmasi perubahan.

+ + + +
+
+
+
+
+ sync.promise.date.wizard.form sync.promise.date.wizard -- cgit v1.2.3 From d2d5a3b514d2974c97fac6eb922f7cd1f7b99096 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 3 Mar 2026 15:51:31 +0700 Subject: fix message --- indoteknik_custom/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 914a5329..723f225c 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -789,7 +789,7 @@ class AccountMove(models.Model): def action_open_change_date_wizard(self): if not self.env.user.is_accounting: - raise UserError('Hanya Accounting yang bisa Reset to Draft') + raise UserError('Hanya Accounting yang bisa edit tanggal journal entry') non_draft = self.filtered(lambda m: m.state != 'draft') if non_draft: raise UserError('Hanya invoice dengan status draft yang bisa diubah tanggalnya. Mohon reset ke draft terlebih dahulu.') -- cgit v1.2.3 From 699450dad70ee7281a5c6d9c6473953dbd227447 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Wed, 4 Mar 2026 08:56:42 +0700 Subject: tambah filter analytics account di general ledger --- indoteknik_custom/views/account_move_line.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indoteknik_custom/views/account_move_line.xml b/indoteknik_custom/views/account_move_line.xml index 346494f3..cb6f6690 100644 --- a/indoteknik_custom/views/account_move_line.xml +++ b/indoteknik_custom/views/account_move_line.xml @@ -24,6 +24,19 @@ + + account.move.line.filter.inherit + account.move.line + + + + + + + -- cgit v1.2.3 From 10f80b660ddf5b60c519ed766057d19115031b99 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Fri, 6 Mar 2026 09:56:18 +0700 Subject: (andri) add search by analytics tag --- indoteknik_custom/views/account_move_line.xml | 32 ++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/views/account_move_line.xml b/indoteknik_custom/views/account_move_line.xml index cb6f6690..1e4b258e 100644 --- a/indoteknik_custom/views/account_move_line.xml +++ b/indoteknik_custom/views/account_move_line.xml @@ -24,17 +24,47 @@ + + account.move.line.tree.grouped.partner.inherit + account.move.line + + + + + + + + account.move.line.filter.inherit account.move.line + + + + -- cgit v1.2.3 From 1d61c5c2f29270d2d1e9c84e887e9c94416d9027 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Fri, 6 Mar 2026 11:03:10 +0700 Subject: fix --- indoteknik_custom/models/purchase_order.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index a345b96b..244575ae 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -1446,8 +1446,8 @@ class PurchaseOrder(models.Model): send_email = True break - if self.partner_id.id == 5571 and not self.revisi_po: - self.action_create_order_altama() + # if self.partner_id.id == 5571 and not self.revisi_po: + # self.action_create_order_altama() if send_email: if self.is_local_env(): @@ -1484,6 +1484,8 @@ class PurchaseOrder(models.Model): # if len(self) == 1: # _logger.info("Redirecting ke BU") # return self.action_view_related_bu() + if self.partner_id.id == 5571 and not self.revisi_po: + self.action_create_order_altama() return res -- cgit v1.2.3 From 5c20bda1e65d72088af744481abf0784d30b710e Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Fri, 6 Mar 2026 14:50:43 +0700 Subject: push --- indoteknik_custom/models/refund_sale_order.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index 646376ab..28f88d0e 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -657,6 +657,20 @@ class RefundSaleOrder(models.Model): ('journal_id', '=', 13), ('state', '=', 'posted'), ]) + if rec.sale_order_ids: + so_records = rec.sale_order_ids + so_names = so_records.mapped('name') + domain = [ + ('journal_id', '=', 13), + ('state', '=', 'posted'), + ('sale_id', '=', False), + ('ref', 'ilike', 'selisih'), + ] + domain += ['|'] * (len(so_names) - 1) + for name in so_names: + domain.append(('ref', 'ilike', name)) + + misc = self.env['account.move'].search(domain) moves_ongkir = self.env['account.move'] if rec.sale_order_ids: -- cgit v1.2.3 From ff474f82cd53d2fd6443fb38018e698186c1123e Mon Sep 17 00:00:00 2001 From: Mqdd Date: Sat, 7 Mar 2026 10:13:42 +0700 Subject: add iqmal sulis in CB --- indoteknik_custom/models/commision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index 983c07fe..afd36bc7 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -443,7 +443,7 @@ class CustomerCommision(models.Model): self.approved_by = (self.approved_by + ', ' if self.approved_by else '') + self.env.user.name self.date_approved_pimpinan = now_naive self.position_pimpinan = 'Pimpinan' - elif self.status == 'pengajuan4' and (self.env.user.id == 1272 or self.env.user.has_group('indoteknik_custom.group_role_it')): + elif self.status == 'pengajuan4' and (self.env.user.id in [1272,14075,571] or self.env.user.has_group('indoteknik_custom.group_role_it')): for line in self.commision_lines: line.invoice_id.is_customer_commision = True if self.commision_type == 'fee': -- cgit v1.2.3 From 492eee56298aeb634f832a723aa0a3918a13c0de Mon Sep 17 00:00:00 2001 From: Mqdd Date: Sat, 7 Mar 2026 10:53:51 +0700 Subject: fix SO approval --- indoteknik_custom/models/sale_order.py | 44 ++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 0cb6670e..e42f0ce3 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -156,7 +156,7 @@ class SaleOrder(models.Model): total_margin_excl_third_party = fields.Float('Before Margin', help="Before Margin in Sales Order Header") approval_status = fields.Selection([ - ('pengajuan0', 'Approval Team Sales'), + ('pengajuan0', 'Approval Leader Team Sales'), ('pengajuan1', 'Approval Manager'), ('pengajuan2', 'Approval Pimpinan'), ('approved', 'Approved'), @@ -2391,12 +2391,15 @@ class SaleOrder(models.Model): self.check_credit_limit() self.check_limit_so_to_invoice() order.approval_status = 'pengajuan0' - order.message_post(body="Mengajukan approval ke Team Sales_") + order.message_post(body="Mengajukan approval ke Leader Team Sales_") + return self._create_approval_notification('Team Sales') + elif order._requires_approval_team_sales(): + self.check_product_bom() + self.check_credit_limit() + self.check_limit_so_to_invoice() + order.approval_status = 'pengajuan0' + order.message_post(body="Mengajukan approval ke Leader Team Sales") return self._create_approval_notification('Team Sales') - elif order._requires_approval_margin_leader(): - order.approval_status = 'pengajuan2' - order.message_post(body="Mengajukan approval ke Pimpinan") - return self._create_approval_notification('Pimpinan') elif order._requires_approval_margin_manager(): self.check_product_bom() self.check_credit_limit() @@ -2404,13 +2407,11 @@ class SaleOrder(models.Model): order.approval_status = 'pengajuan1' order.message_post(body="Mengajukan approval ke Sales Manager") return self._create_approval_notification('Sales Manager') - elif order._requires_approval_team_sales(): - self.check_product_bom() - self.check_credit_limit() - self.check_limit_so_to_invoice() - order.approval_status = 'pengajuan0' - order.message_post(body="Mengajukan approval ke Team Sales") - return self._create_approval_notification('Team Sales') + elif order._requires_approval_margin_leader(): + order.approval_status = 'pengajuan2' + order.message_post(body="Mengajukan approval ke Pimpinan") + return self._create_approval_notification('Pimpinan') + # elif value_trigger: # self.check_product_bom() # self.check_credit_limit() @@ -2685,18 +2686,19 @@ class SaleOrder(models.Model): value_trigger = order._requires_approval_by_value() if value_trigger: order.approval_status = 'pengajuan0' - order.message_post(body="Mengajukan approval ke Team Sales") + order.message_post(body="Mengajukan approval ke Leader Team Sales") return self._create_approval_notification('Team Sales') - elif order._requires_approval_margin_leader(): - order.approval_status = 'pengajuan2' - return self._create_approval_notification('Pimpinan') - elif order._requires_approval_margin_manager(): - order.approval_status = 'pengajuan1' - return self._create_approval_notification('Sales Manager') elif value_trigger or order._requires_approval_team_sales(): order.approval_status = 'pengajuan0' - order.message_post(body="Mengajukan approval ke Team Sales") + order.message_post(body="Mengajukan approval ke Leader Team Sales") return self._create_approval_notification('Team Sales') + elif order._requires_approval_margin_manager(): + order.approval_status = 'pengajuan1' + return self._create_approval_notification('Sales Manager') + elif order._requires_approval_margin_leader(): + order.approval_status = 'pengajuan2' + return self._create_approval_notification('Pimpinan') + # elif value_trigger: # order.approval_status = 'pengajuan0' # order.message_post(body="Mengajukan approval ke Team Sales (Total SO > 50jt)") -- cgit v1.2.3 From 9995484585402c7b2d0b1a22dc6fe8d309238af8 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Sat, 7 Mar 2026 21:09:27 +0700 Subject: add confirmation in create order altama --- indoteknik_custom/views/purchase_order.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index 9651cdd6..581690a1 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -51,6 +51,7 @@ string="Create Order Altama" class="oe_highlight" icon="fa-cloud-upload" + confirm="Yakin ingin Membuat PO ini ke Altama?" attrs="{'invisible': [('partner_id', '!=', 5571)]}" />