fix: check if product_info exists before setting price

This commit is contained in:
prssanna 2021-02-05 17:34:56 +05:30
parent 91a02868cb
commit 91b41db9e3

View File

@ -386,7 +386,8 @@ def get_items(filters=None, search=None):
r.description = r.web_long_description or r.description
r.image = r.website_image or r.image
product_info = get_product_info_for_website(r.item_code, skip_quotation_creation=True).get('product_info')
r.formatted_price = product_info['price'].get('formatted_price') if product_info['price'] else None
if product_info:
r.formatted_price = product_info['price'].get('formatted_price') if product_info['price'] else None
return results