From 8fe189d8f4caeed4b1aff764abc005b4e4ab3979 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 6 Oct 2025 13:59:19 +0700 Subject: change button name and fix wrong validation --- indoteknik_custom/models/stock_picking.py | 8 ++++---- indoteknik_custom/views/stock_picking.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 8408cdc4..be0d77ac 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1338,11 +1338,11 @@ class StockPicking(models.Model): if self.picking_type_id.code == 'incoming' and self.group_id.id == False and self.is_internal_use == False: 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") + # 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_accounting and self.approval_status == 'pengajuan1' and self.location_id.id == 57: - raise UserError("Harus di Approve oleh Accounting") + 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: + raise UserError("Harus di Approve oleh Logistik") if self.picking_type_id.id == 28 and not self.env.user.is_logistic_approver: raise UserError("Harus di Approve oleh Logistik") diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index 7f0865f4..d943f27a 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -49,7 +49,7 @@