summaryrefslogtreecommitdiff
path: root/fixco_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models')
-rw-r--r--fixco_custom/models/shipment_group.py6
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):