summaryrefslogtreecommitdiff
path: root/fixco_custom/models/detail_order.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-06-03 15:39:41 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-06-03 15:39:41 +0700
commit3307dcbdb37285bcd43a719a0ecbc1453e4af9df (patch)
tree81103ea011c3689b3c52304ba1f3e05d31a55853 /fixco_custom/models/detail_order.py
parent50054732da991bdd966f4fba879c33ee853879ff (diff)
upload payments
Diffstat (limited to 'fixco_custom/models/detail_order.py')
-rwxr-xr-xfixco_custom/models/detail_order.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/fixco_custom/models/detail_order.py b/fixco_custom/models/detail_order.py
index e3dc7d7..9cbc446 100755
--- a/fixco_custom/models/detail_order.py
+++ b/fixco_custom/models/detail_order.py
@@ -163,16 +163,19 @@ class DetailOrder(models.Model):
for item in items:
product = self.env['product.product'].search(
- [('default_code', '=', item.get('sku'))],
+ [('default_code', '=', item.get('masterSku'))],
limit=1
)
# raise UserError(_("Product not found for SKU: %s") % item.get('sku'))
line_data = {
- 'product_id': product.id,
+ 'product_id': product.id if product else 5792,
'product_uom_qty': item.get('quantity'),
'price_unit': item.get('actualPrice'),
}
+
+ if not product:
+ line_data['name'] = f"{item.get('masterSku')} ({item.get('productName')})"
order_lines.append((0, 0, line_data))
return order_lines