From bea1370dc724d8675667122384e0d26ecef1ecf9 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 2 Jan 2026 11:11:32 +0700 Subject: change error message --- fixco_custom/models/shipment_group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 01e0f6b..68e5235 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -101,7 +101,7 @@ class ShipmentGroup(models.Model): for picking_line in record.picking_lines: if not picking_line.picking_id: continue - + for move in picking_line.picking_id.move_line_ids_without_package: existing_line = record.shipment_line.filtered( lambda l: l.product_id == move.product_id and @@ -244,7 +244,7 @@ class PickingLine(models.Model): ], limit=1) if not picking: - raise UserError("Receipt '%s' not found." % line.scan_receipt) + raise UserError("Receipt '%s' not found or hasn't been done." % line.scan_receipt) # Isi field otomatis line.picking_id = picking -- cgit v1.2.3 From e513fad4e426c6d4bb57dcd7056637c937a112fd Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 2 Jan 2026 14:50:26 +0700 Subject: scan sgr can use invoice marketplace for gojek --- fixco_custom/models/shipment_group.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 68e5235..8281c53 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -243,8 +243,12 @@ class PickingLine(models.Model): ('tracking_number', '=', line.scan_receipt) ], limit=1) + invoice_marketplce = self.env['stock.picking'].search([ + ('invoice_mp', '=', line.scan_receipt) + ], limit=1) if not picking: - raise UserError("Receipt '%s' not found or hasn't been done." % line.scan_receipt) + if not invoice_marketplce: + raise UserError("Receipt '%s' not found or hasn't been done." % line.scan_receipt) # Isi field otomatis line.picking_id = picking -- cgit v1.2.3 From 9ec47da9aa9da9cfe2e45c97b8da8cfa49148ccc Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 2 Jan 2026 15:04:07 +0700 Subject: fix scan using invoice mp sgr --- fixco_custom/models/shipment_group.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 8281c53..b4ed27b 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -238,25 +238,28 @@ class PickingLine(models.Model): if not line.scan_receipt: continue - # Cari picking picking = self.env['stock.picking'].search([ ('tracking_number', '=', line.scan_receipt) ], limit=1) - invoice_marketplce = self.env['stock.picking'].search([ - ('invoice_mp', '=', line.scan_receipt) - ], limit=1) if not picking: - if not invoice_marketplce: - raise UserError("Receipt '%s' not found or hasn't been done." % line.scan_receipt) + picking = self.env['stock.picking'].search([ + ('invoice_mp', '=', line.scan_receipt) + ], limit=1) - # Isi field otomatis + if not picking: + raise UserError( + "Receipt '%s' not found or hasn't been done." % line.scan_receipt + ) + + # isi field line.picking_id = picking line.carrier = picking.carrier line.order_reference = picking.order_reference line.invoice_marketplace = picking.invoice_mp + class ProductShipmentLine(models.Model): _name = 'product.shipment.line' _description = 'Product Shipment Line' -- cgit v1.2.3