summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-10 21:08:19 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-10 21:08:19 +0700
commite1feb9507aed840000692cb8d2803e48f7393191 (patch)
tree0863fe9f0925155da7a45dc8e796346d9abdb0fe
parent82c1232c08894dad3d6e326649785b5669a12077 (diff)
<Miqdad> limit sgr line
-rw-r--r--fixco_custom/models/shipment_group.py5
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: