[fix] do not pull disabled pos profiles (#11733)
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 9ec5d19..c8e0b16 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -363,11 +363,11 @@
@frappe.whitelist()
def get_pos_profile(company):
pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where user = %s
- and company = %s""", (frappe.session['user'], company), as_dict=1)
+ and company = %s and ifnull(disabled,0) != 1""", (frappe.session['user'], company), as_dict=1)
if not pos_profile:
pos_profile = frappe.db.sql("""select * from `tabPOS Profile`
- where ifnull(user,'') = '' and company = %s""", company, as_dict=1)
+ where ifnull(user,'') = '' and company = %s and ifnull(disabled,0) != 1""", company, as_dict=1)
return pos_profile and pos_profile[0] or None