diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-22 13:37:48 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-22 13:37:48 +0700 |
| commit | fe9056c55bc206a02e52b58baf1881271cf098f8 (patch) | |
| tree | 1f23143a23330d2c087e325cec0e46c5bd458b88 /fixco_custom/models | |
| parent | 1f784b46500d347c6db76ef47161eac959243b1d (diff) | |
<Miqdad> count line in Shipment group
Diffstat (limited to 'fixco_custom/models')
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index aba77f5..3cdba5b 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -35,6 +35,12 @@ class ShipmentGroup(models.Model): picking_lines = fields.One2many('picking.line', 'shipment_id', string='Picking Lines', auto_join=True) related_count = fields.Integer(compute='_compute_related_count', string='Related Count') receipt = fields.Char(string='Receipt', related='picking_lines.scan_receipt') + total_line = fields.Integer(string='Total Line', compute='_compute_total_line') + + @api.depends('picking_lines') + def _compute_total_line(self): + for rec in self: + rec.total_line = len(rec.picking_lines) def sync_product_to_picking_line(self): for shipment in self: |
