From c469f2c954acdae358250cb3eb93ae7be45576e3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Apr 2017 13:01:11 +0530 Subject: [PATCH] Get POS profile fix --- erpnext/stock/get_item_details.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 958da16bac..9b4559e684 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -327,11 +327,10 @@ def get_pos_profile_item_details(company, args, pos_profile=None): @frappe.whitelist() def get_pos_profile(company): - condition = "and company = '%s'"%(company) if company else '' pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where user = %s - {cond}""".format(cond=condition), (frappe.session['user']), as_dict=1) + and company = %s""", (frappe.session['user'], company), as_dict=1) - if not pos_profile and company: + if not pos_profile: pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where ifnull(user,'') = '' and company = %s""", company, as_dict=1)