From 58389ebd402d461903fccb522127bdc1adbbb40e Mon Sep 17 00:00:00 2001 From: Kevin Chan Date: Mon, 12 Oct 2020 15:20:11 +0800 Subject: [PATCH] style: Collapse whitespace --- .../stock/doctype/item_price/item_price.py | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index f88b05cd20..f05de22d01 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -66,21 +66,12 @@ class ItemPrice(Document): if self.get(field): conditions += " and {0} = %({0})s ".format(field) else: - conditions += """ - and ( - isnull({0}) - or {0} = '' - ) - """.format( - field - ) + conditions += "and (isnull({0}) or {0} = '')".format(field) price_list_rate = frappe.db.sql( """ - select - price_list_rate - from - `tabItem Price` + select price_list_rate + from `tabItem Price` {conditions} """.format( conditions=conditions @@ -89,11 +80,7 @@ class ItemPrice(Document): ) if price_list_rate: - frappe.throw(_(""" - Item Price appears multiple times based on - Price List, Supplier/Customer, Currency, Item, UOM, Qty, - and Dates. - """), ItemPriceDuplicateItem,) + frappe.throw(_("Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, UOM, Qty, and Dates."), ItemPriceDuplicateItem,) def before_save(self): if self.selling: