summaryrefslogtreecommitdiff
path: root/fixco_custom/models/shipment_group.py
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models/shipment_group.py')
-rw-r--r--fixco_custom/models/shipment_group.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py
index ca3ef76..546251a 100644
--- a/fixco_custom/models/shipment_group.py
+++ b/fixco_custom/models/shipment_group.py
@@ -38,6 +38,13 @@ class ShipmentGroup(models.Model):
def sync_product_to_picking_line(self):
for shipment in self:
+ cancelled_picking = shipment.picking_lines.filtered(
+ lambda picking: picking.status == 'CANCELLED'
+ )
+ if cancelled_picking:
+ cancelled_names = "\n - " + "\n - ".join(cancelled_picking.mapped("name"))
+ raise UserError(f"Pickings berikut telah dibatalkan:{cancelled_names}")
+
for picking_line in shipment.picking_lines:
shipment_lines = self.env['shipment.group.line'].search([
('shipment_id', '=', shipment.id),