Hi,
POS displays duplicate items when Item marked as Variant. Details explanation found in the below link:
(v11) Strange behaviour in POS with Item Variants (possible BUG)
I modify POS doctype in location …frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py
in function:
> def get_items_list(pos_profile, company): > cond = "" > args_list = [] > if pos_profile.get('item_groups'): > # Get items based on the item groups defined in the POS profile > for d in pos_profile.get('item_groups'): > args_list.extend([d.name for d in get_child_nodes('Item Group', d.item_group)]) > if args_list: > cond = "and i.item_group in (%s)" % (', '.join(['%s'] * len(args_list))) > > return frappe.db.sql(""" > select > i.name, i.item_code, i.item_name, i.description, i.item_group, i.has_batch_no, > i.has_serial_no, i.is_stock_item, i.brand, i.stock_uom, i.image, > id.expense_account, id.selling_cost_center, id.default_warehouse, > i.sales_uom, c.conversion_factor > from > `tabItem` i > left join `tabItem Default` id on id.parent = i.name and id.company = %s > left join `tabUOM Conversion Detail` c on i.name = c.parent and i.sales_uom = c.uom > where > i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1 > {cond} > """.format(cond=cond), tuple([company] + args_list), as_dict=1)
Adding DISTINCT clause in the above select statement is not work. Also, I did not find POS in Doctype list (Setup->DocType/List).
Kindly let me know what is the correct way to modify POS in ERPNext.
-MAK