From e1feb9507aed840000692cb8d2803e48f7393191 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Sat, 10 Jan 2026 21:08:19 +0700 Subject: limit sgr line --- fixco_custom/models/shipment_group.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 4912ce3..12d1fc6 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -37,6 +37,11 @@ class ShipmentGroup(models.Model): receipt = fields.Char(string='Receipt', related='picking_lines.scan_receipt') total_line = fields.Integer(string='Total Line', compute='_compute_total_line') + @api.onchange('picking_lines') + def _onchange_limit_lines(self): + if len(self.picking_lines) >= 100: + raise UserError("Maksimal 100 picking line per shipment.") + @api.depends('picking_lines') def _compute_total_line(self): for rec in self: -- cgit v1.2.3