From 27ae2de4c1deea61dc0891379c8c294e4399b5f7 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 18 Jun 2025 11:50:20 +0700 Subject: sale pricelist, customer type, end line bundling --- fixco_custom/models/detail_order.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'fixco_custom/models/detail_order.py') diff --git a/fixco_custom/models/detail_order.py b/fixco_custom/models/detail_order.py index acac8e6..b2f7625 100755 --- a/fixco_custom/models/detail_order.py +++ b/fixco_custom/models/detail_order.py @@ -85,7 +85,7 @@ class DetailOrder(models.Model): # Cek status response if response.status_code == 200: data = response.json() - self.detail_order = json.dumps(data) + self.detail_order = json.dumps(data, indent=4, sort_keys=True) self.execute_status = 'detail_order' else: self.write({ @@ -172,7 +172,7 @@ class DetailOrder(models.Model): if product and item.get('masterSkuType') == 'BUNDLE': order_lines.append((0, 0, { 'display_type': 'line_note', - 'name': f"Bundle: {item.get('productName')}", + 'name': f"Bundle: {item.get('productName')}, Qty: {item.get('quantity')}, Master SKU: {item.get('masterSku')}", 'product_uom_qty': 0, 'price_unit': 0, })) @@ -185,6 +185,13 @@ class DetailOrder(models.Model): 'price_unit': bline.price * bline.product_uom_qty if bline.price else item.get('actualPrice'), 'name': f"{bline.variant_id.display_name} (Bundle Component)" if bline.variant_id.display_name else product.name, })) + + order_lines.append((0, 0, { + 'display_type': 'line_note', + 'name': f"End Of Bundling Product", + 'product_uom_qty': 0, + 'price_unit': 0, + })) continue line_data = { -- cgit v1.2.3