diff options
| -rw-r--r-- | fixco_custom/models/shipment_group.py | 7 | ||||
| -rw-r--r-- | fixco_custom/views/shipment_group.xml | 2 |
2 files changed, 9 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): diff --git a/fixco_custom/views/shipment_group.xml b/fixco_custom/views/shipment_group.xml index 4aae314..e298475 100644 --- a/fixco_custom/views/shipment_group.xml +++ b/fixco_custom/views/shipment_group.xml @@ -7,6 +7,7 @@ <tree default_order="create_date desc"> <field name="number"/> <field name="total_line" readonly="1"/> + <field name="shipment_method" readonly="1"/> </tree> </field> </record> @@ -40,6 +41,7 @@ <group> <field name="number" readonly="1"/> <field name="total_line" readonly="1"/> + <field name="shipment_method" readonly="1"/> </group> </group> <notebook> |
