From dfbaf01dfb9d181f7422a25c9214f28b018b6125 Mon Sep 17 00:00:00 2001 From: "DESKTOP-IQ6LM3K\\Jose Antonio" Date: Tue, 21 May 2024 15:00:24 -0600 Subject: [PATCH] [IMP] api: Remove fields in shipping_info Removed unnecessary fields from the shipping_info in the get_shipping_info endpoint. This change simplifies the response structure and improves performance. Changes: - Removed specific fields from the shipping_info response to streamline the data returned by the endpoint. Closes #25 --- hantec_api_ecommerce/models/sale_order.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/hantec_api_ecommerce/models/sale_order.py b/hantec_api_ecommerce/models/sale_order.py index a0713b1..4287f4b 100644 --- a/hantec_api_ecommerce/models/sale_order.py +++ b/hantec_api_ecommerce/models/sale_order.py @@ -13,7 +13,6 @@ def get_shipping_info(self): Returns: dict: A dictionary containing the shipping information. """ - # Delivery address data shipping_address = self.partner_shipping_id fields = [ @@ -29,19 +28,6 @@ def get_shipping_info(self): ] address_data = shipping_address.read(fields)[0] if shipping_address else {} - address_data.update( - { - "state": ( - shipping_address.state_id.name if shipping_address.state_id else "" - ), - "country": ( - shipping_address.country_id.name - if shipping_address.country_id - else "" - ), - } - ) - # Get related shipping records pickings = self.picking_ids @@ -63,7 +49,6 @@ def get_shipping_info(self): "name": picking.name, "scheduled_date": picking.scheduled_date, "state": picking.state, - "tracking_reference": picking.carrier_tracking_ref, "lines": lines_data, "address_data": address_data, }