diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-02 19:14:37 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-02 19:14:37 +0700 |
| commit | eb797ba942694d697d8681debcf467042bfa7b79 (patch) | |
| tree | 9da49fb11d46c1cb6da0b886a9529b1db2adfae0 | |
| parent | 42ff804b61b635c8be662784d03a7bd8e87b8bbe (diff) | |
<Miqdad> balikin sgr
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 19 |
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') |
