diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py index 74cc217d28a..f3954584e7b 100644 --- a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -94,6 +94,11 @@ class DocType(DocListController): price_list_currency_map = webnotes.conn.get_values("Price List", [d.selling_price_list for d in self.doclist.get({"parentfield": "price_lists"})], "currency") + + # check if all price lists have a currency + for price_list, currency in price_list_currency_map.items(): + if not currency: + webnotes.throw("%s: %s" % (_("Currency is missing for Price List"), price_list)) expected_to_exist = [currency + "-" + company_currency for currency in price_list_currency_map.values()