Merge pull request #24555 from prssanna/product-query-fix

fix: check if product_info exists
This commit is contained in:
Prssanna Desai 2021-02-05 14:54:23 +05:30 committed by GitHub
commit b8f4cdfbce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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