diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 13:30:41 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 13:30:41 +0700 |
| commit | d7d78bf11e4bb3a00271b2ad2c8d0196e2b6a27c (patch) | |
| tree | b6db370aa8486af5fea6beef434c0491a2257d7b | |
| parent | d654707d4938508b5389cfbb679d64679be99227 (diff) | |
<Miqdad> fix error shipment method sgr
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fixco_custom/models/shipment_group.py b/fixco_custom/models/shipment_group.py index 0e5ceb0..4832dd5 100644 --- a/fixco_custom/models/shipment_group.py +++ b/fixco_custom/models/shipment_group.py @@ -36,13 +36,15 @@ 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') + shipment_methods = 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 + carriers = [c for c in carriers if c] + rec.shipment_method = ', '.join(sorted(set(carriers))) if carriers else '-' + @api.onchange('picking_lines') def _onchange_limit_lines(self): |
