Get POS profile fix

This commit is contained in:
Nabin Hait 2017-04-03 13:01:11 +05:30
parent 731efe3a95
commit c469f2c954

View File

@ -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)