summaryrefslogtreecommitdiff
path: root/fixco_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models')
-rw-r--r--fixco_custom/models/shipment_group.py15
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'