diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-28 15:23:38 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-28 15:23:38 +0700 |
| commit | 364eb8f589e5070c06e10bb5895e20e69dad8249 (patch) | |
| tree | 93e223903a10ea7c59e3cdd96192351ff69d32cc | |
| parent | ea81f5a5b5eedfffcfa15a3f752ccc81df6eed04 (diff) | |
add shipping_method_picking on sale order
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 9 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 1 |
2 files changed, 10 insertions, 0 deletions
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 @@ <field name="payment_type" optional="hide"/> <field name="payment_status" optional="hide"/> <field name="pareto_status" optional="hide"/> + <field name="shipping_method_picking" optional="hide"/> </field> </field> </record> |
