summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-02-04 13:26:20 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-02-04 13:26:20 +0700
commitd654707d4938508b5389cfbb679d64679be99227 (patch)
treeab79dc28b6e1284b57aebd0716d348701a0a1fac
parentc48b75c795c3298a707ff3afa5c91a5d161fe312 (diff)
<Miqdad> add compute shipment method sgr
-rw-r--r--fixco_custom/models/shipment_group.py7
-rw-r--r--fixco_custom/views/shipment_group.xml2
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>