From a7820f310ca4efd59a7d585c6fa7567797579ecb Mon Sep 17 00:00:00 2001 From: prssanna Date: Fri, 5 Feb 2021 14:52:31 +0530 Subject: [PATCH] fix: check if product_info exists --- erpnext/shopping_cart/product_query.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/product_query.py b/erpnext/shopping_cart/product_query.py index da9e798327..8daf3d7dac 100644 --- a/erpnext/shopping_cart/product_query.py +++ b/erpnext/shopping_cart/product_query.py @@ -73,7 +73,8 @@ class ProductQuery: for item in result: product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True).get('product_info') - item.formatted_price = product_info['price'].get('formatted_price') if product_info['price'] else None + if product_info: + item.formatted_price = product_info['price'].get('formatted_price') if product_info['price'] else None return result