diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-02 15:14:10 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-02 15:14:10 +0700 |
| commit | e86ff296c94c3624fe3fdaf988dc4c37e49eed05 (patch) | |
| tree | d9421a197a7df89e9aa770010423594d2c7c62fd | |
| parent | 1d366c28b52cf77f2bb1059d2945a874cf7775ba (diff) | |
| parent | 9ec47da9aa9da9cfe2e45c97b8da8cfa49148ccc (diff) | |
Merge branch 'main' of bitbucket.org:altafixco/fixco-addons
pull
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 01e0f6b..b4ed27b 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 @@ -238,21 +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) if not picking: - raise UserError("Receipt '%s' not found." % 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' |
