From a2ba8ea74a39403d9cd2fd2cc2af895059d9cdf8 Mon Sep 17 00:00:00 2001 From: Kevin Chan Date: Tue, 3 Nov 2020 10:57:52 +0800 Subject: [PATCH] style: Clean up code formatting --- .../stock/doctype/item_price/item_price.py | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index 54f534f3d1..bed5ea9ab6 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -46,12 +46,7 @@ class ItemPrice(Document): self.item_name, self.item_description = frappe.db.get_value("Item", self.item_code,["item_name", "description"]) def check_duplicates(self): - conditions = """ - where - item_code = %(item_code)s - and price_list = %(price_list)s - and name != %(name)s - """ + conditions = """where item_code = %(item_code)s and price_list = %(price_list)s and name != %(name)s""" for field in [ "uom", @@ -59,23 +54,18 @@ class ItemPrice(Document): "valid_upto", "packing_unit", "customer", - "supplier", - ]: + "supplier",]: if self.get(field): conditions += " and {0} = %({0})s ".format(field) else: conditions += "and (isnull({0}) or {0} = '')".format(field) - price_list_rate = frappe.db.sql( - """ + price_list_rate = frappe.db.sql(""" select price_list_rate from `tabItem Price` {conditions} - """.format( - conditions=conditions - ), - self.as_dict(), - ) + """.format(conditions=conditions), + self.as_dict(),) if price_list_rate: frappe.throw(_("Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, UOM, Qty, and Dates."), ItemPriceDuplicateItem,)