From 13f131132a140e3d3b7f551d19d76a4f32a49f6b Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Tue, 7 Oct 2025 15:06:01 +0700 Subject: push --- indoteknik_custom/models/refund_sale_order.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index f9adeeff..47565dfc 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -304,12 +304,14 @@ class RefundSaleOrder(models.Model): ('state', '=', 'posted'), ]) - misc = self.env['account.move'].search([ - ('ref', 'ilike', invoices.mapped('name')[0]), - ('ref', 'not ilike', 'reklas'), - ('journal_id', '=', 13), - ('state', '=', 'posted'), - ]) + misc = self.env['account.move'] + if invoices: + misc = self.env['account.move'].search([ + ('ref', 'ilike', invoices.mapped('name')[0]), + ('ref', 'not ilike', 'reklas'), + ('journal_id', '=', 13), + ('state', '=', 'posted'), + ]) moves2 = self.env['account.move'] if so_ids: so_names = self.env['sale.order'].browse(so_ids).mapped('name') -- cgit v1.2.3 From 3c7176c6d87c4a1385e5a87e119878b6e9a5d88f Mon Sep 17 00:00:00 2001 From: Miqdad Date: Tue, 7 Oct 2025 15:08:17 +0700 Subject: add more vals IU approval --- indoteknik_custom/models/stock_picking.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index a2bd7339..51b6276c 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1340,11 +1340,14 @@ class StockPicking(models.Model): raise UserError(_('Tidak bisa Validate jika tidak dari Document SO / PO')) # if self.is_internal_use and not self.env.user.is_logistic_approver and self.location_id.id == 57 and self.approval_status == 'pengajuan2': - # raise UserError("Harus di Approve oleh Logistik") + # raise UserError("Harus di Approve oleh Logistik") - if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan1', 'pengajuan2'] and self.location_id.id == 57: + if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan1', 'pengajuan2'] and self.location_id.id == 57 and self.is_bu_iu == True and 'BU/IU' in self.name: raise UserError("Harus di Approve oleh Logistik") + if self.is_internal_use and not self.env.user.is_accounting and self.approval_status in ['pengajuan1', '', False] and self.is_bu_iu == False: + raise UserError("Harus di Approve oleh Accounting") + if self.picking_type_id.id == 28 and not self.env.user.is_logistic_approver: raise UserError("Harus di Approve oleh Logistik") @@ -1353,7 +1356,7 @@ class StockPicking(models.Model): if self.is_internal_use and self.approval_status == 'pengajuan2': self.approval_status = 'approved' - elif self.is_internal_use and self.approval_status in ['pengajuan1', '', False]: + elif self.is_internal_use and self.approval_status in ['pengajuan1', '', False] and 'BU/IU' in self.name and self.is_bu_iu == True: raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu") elif self.picking_type_id.code == 'incoming': self.approval_receipt_status = 'approved' -- cgit v1.2.3 From 92d28be458ca53c9994a175225232b24c7fde283 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Tue, 7 Oct 2025 15:20:29 +0700 Subject: fix approval IU --- indoteknik_custom/models/stock_picking.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 51b6276c..4772c433 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1342,7 +1342,10 @@ class StockPicking(models.Model): # if self.is_internal_use and not self.env.user.is_logistic_approver and self.location_id.id == 57 and self.approval_status == 'pengajuan2': # raise UserError("Harus di Approve oleh Logistik") - if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan1', 'pengajuan2'] and self.location_id.id == 57 and self.is_bu_iu == True and 'BU/IU' in self.name: + if self.is_internal_use and self.approval_status in ['pengajuan1', '', False] and 'BU/IU' in self.name and self.is_bu_iu == True: + raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu") + + if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan2'] and self.is_bu_iu == True and 'BU/IU' in self.name: raise UserError("Harus di Approve oleh Logistik") if self.is_internal_use and not self.env.user.is_accounting and self.approval_status in ['pengajuan1', '', False] and self.is_bu_iu == False: @@ -1356,8 +1359,6 @@ class StockPicking(models.Model): if self.is_internal_use and self.approval_status == 'pengajuan2': self.approval_status = 'approved' - elif self.is_internal_use and self.approval_status in ['pengajuan1', '', False] and 'BU/IU' in self.name and self.is_bu_iu == True: - raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu") elif self.picking_type_id.code == 'incoming': self.approval_receipt_status = 'approved' -- cgit v1.2.3