summaryrefslogtreecommitdiff
path: root/fixco_custom/models/detail_order.py
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models/detail_order.py')
-rwxr-xr-xfixco_custom/models/detail_order.py11
1 files changed, 9 insertions, 2 deletions
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 = {