diff options
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 5 |
1 files changed, 5 insertions, 0 deletions
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: |
