diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-09 19:18:47 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-09 19:18:47 +0700 |
| commit | e0f9a4fb3968714408b90217878c2d37e68a6b99 (patch) | |
| tree | dfeaaee2540db389e13bd45a5a8b73fe4867a608 | |
| parent | 82c1232c08894dad3d6e326649785b5669a12077 (diff) | |
<Miqdad> onchnage sgr duplicateonchange_sgr
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 12 |
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 |
