From 2a77c2a565bc6f8139af830853e1c06625593f44 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 8 Dec 2025 16:14:00 +0700 Subject: push --- fixco_custom/models/shipment_group.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fixco_custom/models/shipment_group.py') 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), -- cgit v1.2.3