style: Clean up code formatting
This commit is contained in:
parent
312561fd77
commit
a2ba8ea74a
@ -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,)
|
||||
|
Loading…
x
Reference in New Issue
Block a user