summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-02 19:14:37 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-02 19:14:37 +0700
commiteb797ba942694d697d8681debcf467042bfa7b79 (patch)
tree9da49fb11d46c1cb6da0b886a9529b1db2adfae0
parent42ff804b61b635c8be662784d03a7bd8e87b8bbe (diff)
<Miqdad> balikin sgr
-rw-r--r--fixco_custom/models/shipment_group.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py
index 2663cd9..b4ed27b 100644
--- a/fixco_custom/models/shipment_group.py
+++ b/fixco_custom/models/shipment_group.py
@@ -215,22 +215,9 @@ class PickingLine(models.Model):
# ('id', '!=', line.id)
], limit=1)
- dup2 = self.search([
- ('scan_receipt', '=', line.invoice_marketplace),
- # ('id', '!=', line.id)
- ], limit=1)
-
- if not (dup or dup2):
+ if not dup:
continue
- if dup:
- raise ValidationError(
- "Receipt '%s' sudah digunakan di Shipment %s." %
- (line.scan_receipt, dup.shipment_id.number or '-')
- )
- else:
- raise UserError("Invoice Marketplace sudah digunakan")
-
# 1. Dup di shipment yang sama (lagi create / edit)
# if dup.shipment_id.id == line.shipment_id.id:
# raise ValidationError(
@@ -239,6 +226,10 @@ class PickingLine(models.Model):
# )
# 2. Dup di shipment lain (data lama)
+ raise ValidationError(
+ "Receipt '%s' sudah digunakan di Shipment %s." %
+ (line.scan_receipt, dup.shipment_id.number or '-')
+ )
@api.onchange('scan_receipt')