summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-03-07 20:19:23 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-03-07 20:19:23 +0700
commit8ae02f541b23a2d224094419333ed76f46eab402 (patch)
tree03d2dc05d757081a323be6c023cd60a605608d73
parenteb39bec92f2e2fef2be5bf64a7c165ecd9787601 (diff)
<Miqdad> fix code. fallback using sku if mastersku is not available
-rwxr-xr-xfixco_custom/models/detail_order.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/fixco_custom/models/detail_order.py b/fixco_custom/models/detail_order.py
index 7d78122..f5b766a 100755
--- a/fixco_custom/models/detail_order.py
+++ b/fixco_custom/models/detail_order.py
@@ -257,9 +257,9 @@ class DetailOrder(models.Model):
product_quantities = {}
for item in items:
- key = item.get('sku', "")
- if key == "" or key == False:
- key = item.get('masterSku', "")
+ key = item.get('masterSku')
+ if not key or key in ["", False]:
+ key = item.get('sku', "")
qty = item.get('quantity', 0)
price = item.get('actualPrice', 0)