From 93199aaed1ae3541fd9ecf5c0aa42b20140a7ad4 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 10 Dec 2025 10:49:31 +0700 Subject: fix validate retur from vrt or prt manually --- indoteknik_custom/models/stock_picking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 155664cb..cc6b69a3 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1463,7 +1463,8 @@ class StockPicking(models.Model): group_id = self.env.ref('indoteknik_custom.group_role_merchandiser').id users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])]) active_model = self.env.context.get('active_model') - self.validate_seq_vcm() + if self.tukar_guling_po_id: + self.validate_seq_vcm() if self.is_so_fiktif == True: raise UserError("SO Fiktif tidak bisa di validate") if self.location_id.id == 47 and self.env.user.id not in users_in_group.mapped( -- cgit v1.2.3 From 6f1b2a4337279a946ae999df38ba5682044a3bb2 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 10 Dec 2025 11:11:01 +0700 Subject: fix sementara seq vcm --- indoteknik_custom/models/stock_picking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index cc6b69a3..7970793e 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1435,8 +1435,8 @@ class StockPicking(models.Model): ordered_pickings = [] for prefix in picking_order: match = next((p for p in related_pickings if p.name.startswith(prefix)), None) - if not match: - raise UserError(f"Picking dengan prefix {prefix} belum ada.") + # if not match: + # raise UserError(f"Picking dengan prefix {prefix} belum ada.") ordered_pickings.append(match) current_index = -1 -- cgit v1.2.3 From 2c65cad93b296c059a7feb6b1d1fca3331981c89 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 10 Dec 2025 11:15:26 +0700 Subject: fix smweentara --- indoteknik_custom/models/stock_picking.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 7970793e..6c498367 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1435,8 +1435,8 @@ class StockPicking(models.Model): ordered_pickings = [] for prefix in picking_order: match = next((p for p in related_pickings if p.name.startswith(prefix)), None) - # if not match: - # raise UserError(f"Picking dengan prefix {prefix} belum ada.") + if not match: + raise UserError(f"Picking dengan prefix {prefix} belum ada.") ordered_pickings.append(match) current_index = -1 @@ -1463,8 +1463,8 @@ class StockPicking(models.Model): group_id = self.env.ref('indoteknik_custom.group_role_merchandiser').id users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])]) active_model = self.env.context.get('active_model') - if self.tukar_guling_po_id: - self.validate_seq_vcm() + # if self.tukar_guling_po_id: + # self.validate_seq_vcm() if self.is_so_fiktif == True: raise UserError("SO Fiktif tidak bisa di validate") if self.location_id.id == 47 and self.env.user.id not in users_in_group.mapped( -- cgit v1.2.3 From d746dacecc64c2effb9166b54808f0e81ea8303f Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 10 Dec 2025 11:23:04 +0700 Subject: run validate seq vcm when return type tukar guling --- indoteknik_custom/models/stock_picking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 6c498367..2f99a85a 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1463,8 +1463,8 @@ class StockPicking(models.Model): group_id = self.env.ref('indoteknik_custom.group_role_merchandiser').id users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])]) active_model = self.env.context.get('active_model') - # if self.tukar_guling_po_id: - # self.validate_seq_vcm() + if self.tukar_guling_po_id and self.tukar_guling_po_id.return_type == 'tukar_guling': + self.validate_seq_vcm() if self.is_so_fiktif == True: raise UserError("SO Fiktif tidak bisa di validate") if self.location_id.id == 47 and self.env.user.id not in users_in_group.mapped( -- cgit v1.2.3