From 8c002491d09e684c9f08a45179a609e1a8355ce6 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 17 Sep 2013 15:57:17 +0530 Subject: [PATCH] [fix] [minor] show missing currency message in shopping cart settings --- .../doctype/shopping_cart_settings/shopping_cart_settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py index 74cc217d28..f3954584e7 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()