From 5d51a05b422fb259e14288fd1271a8c7e65a6aa4 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 2 Mar 2026 09:03:11 +0700 Subject: push --- indoteknik_custom/models/account_asset.py | 111 ++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/account_asset.py b/indoteknik_custom/models/account_asset.py index 211ab229..c54f1d97 100644 --- a/indoteknik_custom/models/account_asset.py +++ b/indoteknik_custom/models/account_asset.py @@ -14,3 +14,114 @@ class AccountAsset(models.Model): if asset.value > 0: raise UserError("Asset masih mempunyai Value") asset.state = 'close' + + def create_move(self, post_move=True): + created_moves = self.env['account.move'] + prec = self.env['decimal.precision'].precision_get('Account') + if self.mapped('move_id'): + raise UserError(_( + 'This depreciation is already linked to a journal entry! Please post or delete it.')) + for line in self: + category_id = line.asset_id.category_id + depreciation_date = self.env.context.get( + 'depreciation_date') or line.depreciation_date or fields.Date.context_today( + self) + company_currency = line.asset_id.company_id.currency_id + current_currency = line.asset_id.currency_id + amount = current_currency.with_context( + date=depreciation_date).compute(line.amount, company_currency) + asset_name = line.asset_id.name + ' (%s/%s)' % ( + line.sequence, len(line.asset_id.depreciation_line_ids)) + partner = self.env['res.partner']._find_accounting_partner( + line.asset_id.partner_id) + move_line_1 = { + 'name': asset_name, + 'account_id': category_id.account_depreciation_id.id, + 'debit': 0.0 if float_compare(amount, 0.0, + precision_digits=prec) > 0 else -amount, + 'credit': amount if float_compare(amount, 0.0, + precision_digits=prec) > 0 else 0.0, + 'journal_id': category_id.journal_id.id, + 'partner_id': partner.id, + 'analytic_account_id': category_id.account_analytic_id.id if category_id.type == 'sale' else False, + 'currency_id': company_currency != current_currency and current_currency.id or False, + 'amount_currency': company_currency != current_currency and - 1.0 * line.amount or 0.0, + } + move_line_2 = { + 'name': asset_name, + 'account_id': category_id.account_depreciation_expense_id.id, + 'credit': 0.0 if float_compare(amount, 0.0, + precision_digits=prec) > 0 else -amount, + 'debit': amount if float_compare(amount, 0.0, + precision_digits=prec) > 0 else 0.0, + 'journal_id': category_id.journal_id.id, + 'partner_id': partner.id, + 'analytic_account_id': category_id.account_analytic_id.id if category_id.type == 'purchase' else False, + 'currency_id': company_currency != current_currency and current_currency.id or False, + 'amount_currency': company_currency != current_currency and line.amount or 0.0, + } + move_vals = { + 'ref': line.asset_id.code, + 'date': depreciation_date or False, + 'journal_id': category_id.journal_id.id, + 'line_ids': [(0, 0, move_line_1), (0, 0, move_line_2)], + } + move = self.env['account.move'].create(move_vals) + line.write({'move_id': move.id, 'move_check': True}) + created_moves |= move + + if post_move and created_moves: + created_moves.filtered(lambda m: any( + m.asset_depreciation_ids.mapped( + 'asset_id.category_id.open_asset'))).post() + created_moves.action_post() + return [x.id for x in created_moves] + + def create_grouped_move(self, post_move=True): + if not self.exists(): + return [] + + created_moves = self.env['account.move'] + category_id = self[ + 0].asset_id.category_id # we can suppose that all lines have the same category + depreciation_date = self.env.context.get( + 'depreciation_date') or fields.Date.context_today(self) + amount = 0.0 + for line in self: + # Sum amount of all depreciation lines + company_currency = line.asset_id.company_id.currency_id + current_currency = line.asset_id.currency_id + amount += current_currency.compute(line.amount, company_currency) + + name = category_id.name + _(' (grouped)') + move_line_1 = { + 'name': name, + 'account_id': category_id.account_depreciation_id.id, + 'debit': 0.0, + 'credit': amount, + 'journal_id': category_id.journal_id.id, + 'analytic_account_id': category_id.account_analytic_id.id if category_id.type == 'sale' else False, + } + move_line_2 = { + 'name': name, + 'account_id': category_id.account_depreciation_expense_id.id, + 'credit': 0.0, + 'debit': amount, + 'journal_id': category_id.journal_id.id, + 'analytic_account_id': category_id.account_analytic_id.id if category_id.type == 'purchase' else False, + } + move_vals = { + 'ref': category_id.name, + 'date': depreciation_date or False, + 'journal_id': category_id.journal_id.id, + 'line_ids': [(0, 0, move_line_1), (0, 0, move_line_2)], + } + move = self.env['account.move'].create(move_vals) + self.write({'move_id': move.id, 'move_check': True}) + created_moves |= move + + if post_move and created_moves: + self.post_lines_and_close_asset() + created_moves.post() + created_moves.action_post() + return [x.id for x in created_moves] \ No newline at end of file -- cgit v1.2.3 From 199676d2864dd29faebee8b329785b179156f47d Mon Sep 17 00:00:00 2001 From: Mqdd Date: Mon, 2 Mar 2026 09:12:04 +0700 Subject: fix typo --- indoteknik_custom/models/tukar_guling_po.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py index 1ee10679..9038dd28 100644 --- a/indoteknik_custom/models/tukar_guling_po.py +++ b/indoteknik_custom/models/tukar_guling_po.py @@ -533,7 +533,7 @@ class TukarGulingPO(models.Model): ('state', '=', 'done'), ('picking_type_id.id', '=', 75) ]) - if self.state == 'aproved' and total_put > 0 and put == total_put: + if self.state == 'approved' and total_put > 0 and put == total_put: self.state = 'done' -- cgit v1.2.3 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(-) (limited to 'indoteknik_custom') 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 From 837df993141041c9d1d19b8ea8de82c6fae9dc99 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Mon, 2 Mar 2026 09:59:00 +0700 Subject: (andri) add customer reference pada mail faktur pajak khusus customer tertentu --- indoteknik_custom/models/account_move.py | 3 ++- indoteknik_custom/views/mail_template_efaktur.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 42467b78..a317dccc 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -601,6 +601,7 @@ class AccountMove(models.Model): template.send_mail(record.id, email_values=email_values, force_send=True) elif record.partner_id.id in special_partner_ids: + cust_ref = record.sale_id.client_order_ref if record.sale_id and record.sale_id.client_order_ref else '' attachment = self.generate_attachment(record) email_list = [record.partner_id.email] if record.partner_id.email else [] if record.real_invoice_id and record.real_invoice_id.email: @@ -610,7 +611,7 @@ class AccountMove(models.Model): 'email_to': ",".join(set(email_list)), 'attachment_ids': [(4, attachment.id)] } - template.send_mail(record.id, email_values=email_values, force_send=True) + template.with_context(cust_ref=cust_ref).send_mail(record.id, email_values=email_values, force_send=True) # @api.model # def create(self, vals): diff --git a/indoteknik_custom/views/mail_template_efaktur.xml b/indoteknik_custom/views/mail_template_efaktur.xml index b0637691..c539ccd1 100644 --- a/indoteknik_custom/views/mail_template_efaktur.xml +++ b/indoteknik_custom/views/mail_template_efaktur.xml @@ -11,7 +11,7 @@ ${object.partner_id.email|safe}

Dengan Hormat Bpk/Ibu ${object.partner_id.name},

-

Terlampir Faktur Pajak atas Invoice ${object.name}.

+

Terlampir Faktur Pajak atas Invoice ${object.name} ${ctx.get('cust_ref') and ' (' + ctx.get('cust_ref') + ')' or '.'}

Keterangan:

Mohon dicek langsung faktur pajak terlampir, terutama informasi nomor NPWP dan alamat NPWP serta nama pembelian barang. Jika ada yang tidak sesuai, mohon segera menginformasikan kepada kami paling lambat 1 (satu) minggu dari tanggal email ini. Revisi faktur pajak tidak dapat kami proses apabila sudah melewati 1 (satu) minggu. Harap maklum.

Mohon balas email ini jika sudah menerima, terima kasih.

-- cgit v1.2.3 From 5971d8f9e3543945148b7e06cf0e4ee1a0685603 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Mon, 2 Mar 2026 10:10:56 +0700 Subject: fix --- indoteknik_custom/views/mail_template_efaktur.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/views/mail_template_efaktur.xml b/indoteknik_custom/views/mail_template_efaktur.xml index c539ccd1..ea473364 100644 --- a/indoteknik_custom/views/mail_template_efaktur.xml +++ b/indoteknik_custom/views/mail_template_efaktur.xml @@ -11,7 +11,7 @@ ${object.partner_id.email|safe}

Dengan Hormat Bpk/Ibu ${object.partner_id.name},

-

Terlampir Faktur Pajak atas Invoice ${object.name} ${ctx.get('cust_ref') and ' (' + ctx.get('cust_ref') + ')' or '.'}

+

Terlampir Faktur Pajak atas Invoice ${object.name}${ ' (%s)' % ctx.get('cust_ref') if ctx.get('cust_ref') else '' }

Keterangan:

Mohon dicek langsung faktur pajak terlampir, terutama informasi nomor NPWP dan alamat NPWP serta nama pembelian barang. Jika ada yang tidak sesuai, mohon segera menginformasikan kepada kami paling lambat 1 (satu) minggu dari tanggal email ini. Revisi faktur pajak tidak dapat kami proses apabila sudah melewati 1 (satu) minggu. Harap maklum.

Mohon balas email ini jika sudah menerima, terima kasih.

-- cgit v1.2.3 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(+) (limited to 'indoteknik_custom') 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(-) (limited to 'indoteknik_custom') 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(+) (limited to 'indoteknik_custom') 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 004ea4b603f6121b536c0639f4a5e1bc538eecd5 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Thu, 5 Mar 2026 13:23:12 +0700 Subject: make all field optional hide purchasing job --- indoteknik_custom/views/purchasing_job.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/views/purchasing_job.xml b/indoteknik_custom/views/purchasing_job.xml index 8e1eb3b6..16fbb01a 100644 --- a/indoteknik_custom/views/purchasing_job.xml +++ b/indoteknik_custom/views/purchasing_job.xml @@ -7,20 +7,20 @@ - - - - - - - - - + + + + + + + + + - + - - + +