From 364eb8f589e5070c06e10bb5895e20e69dad8249 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 28 Jan 2025 15:23:38 +0700 Subject: add shipping_method_picking on sale order --- indoteknik_custom/models/sale_order.py | 9 +++++++++ indoteknik_custom/views/sale_order.xml | 1 + 2 files changed, 10 insertions(+) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 48195b77..98468c4b 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -144,6 +144,15 @@ class SaleOrder(models.Model): ('PNR', 'Pareto Non Repeating'), ('NP', 'Non Pareto') ]) + shipping_method_picking = fields.Char(string='Shipping Method Picking', compute='_compute_shipping_method_picking') + + def _compute_shipping_method_picking(self): + for order in self: + if order.picking_ids: + carrier_names = order.picking_ids.mapped('carrier_id.name') + order.shipping_method_picking = ', '.join(filter(None, carrier_names)) + else: + order.shipping_method_picking = False @api.onchange('payment_status') def _is_continue_transaction(self): diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 6a80d586..2a46901a 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -296,6 +296,7 @@ + -- cgit v1.2.3