diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 13:26:20 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 13:26:20 +0700 |
| commit | d654707d4938508b5389cfbb679d64679be99227 (patch) | |
| tree | ab79dc28b6e1284b57aebd0716d348701a0a1fac /fixco_custom/models | |
| parent | c48b75c795c3298a707ff3afa5c91a5d161fe312 (diff) | |
<Miqdad> add compute shipment method sgr
Diffstat (limited to 'fixco_custom/models')
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 12d1fc6..0e5ceb0 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -36,6 +36,13 @@ class ShipmentGroup(models.Model): 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') + shipment_method = fields.Text(string='Shipment Method', help='Metode Pengiriman Barang', compute='_compute_shipment_method') + + @api.depends('picking_lines.carrier') + def _compute_shipment_method(self): + for rec in self: + carriers = rec.picking_lines.mapped('carrier') + rec.shipment_method = ', '.join(set(carriers)) if carriers else False @api.onchange('picking_lines') def _onchange_limit_lines(self): |
