summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fixco_custom/models/shipment_group.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py
index 4912ce3..3216c13 100644
--- a/fixco_custom/models/shipment_group.py
+++ b/fixco_custom/models/shipment_group.py
@@ -318,6 +318,18 @@ class PickingLine(models.Model):
"Receipt '%s' Tidak ditemukan / Status Picking tidak Done." % line.scan_receipt
)
+ exist = self.search([
+ '|',
+ ('scan_receipt', '=', line.scan_receipt),
+ ('invoice_marketplace', '=', line.scan_receipt),
+ ], limit=1)
+
+ if exist:
+ if exist.id != line.id:
+ raise UserError(
+ "Receipt '%s' sudah digunakan di Picking Line lain." % line.scan_receipt
+ )
+
# isi field
line.picking_id = picking
line.carrier = picking.carrier