summaryrefslogtreecommitdiff
path: root/fixco_custom/models/shipment_group.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-12-08 16:14:00 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-12-08 16:14:00 +0700
commit2a77c2a565bc6f8139af830853e1c06625593f44 (patch)
treeb7d475aaea7fdcd54afbf4e53697061517976509 /fixco_custom/models/shipment_group.py
parent6b255061a752a5d8cc9af65b98f39cf0abe1824d (diff)
push
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),