From b83fa3bc2d5f23c5fea1ccceff6f684d13880726 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 2 Mar 2015 18:25:14 +0530 Subject: [PATCH] [pos] [barcode] fixes #2831 --- erpnext/accounts/doctype/sales_invoice/pos.py | 2 +- erpnext/public/js/pos/pos.js | 4 ++-- erpnext/stock/doctype/item/item.json | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 36d404489a..bfdee2d481 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -23,7 +23,7 @@ def get_items(price_list, sales_or_purchase, item=None): return item_code # search barcode - item_code = frappe.db.sql("""select name from `tabItem` where barcode=%s""", + item_code = frappe.db.sql("""select name, item_code from `tabItem` where barcode=%s""", (item), as_dict=1) if item_code: item_code[0]["barcode"] = item diff --git a/erpnext/public/js/pos/pos.js b/erpnext/public/js/pos/pos.js index 5aaadb483a..8780ed8e7e 100644 --- a/erpnext/public/js/pos/pos.js +++ b/erpnext/public/js/pos/pos.js @@ -108,12 +108,12 @@ erpnext.pos.PointOfSale = Class.extend({ var item = r.message[0]; if (item.serial_no) { me.add_to_cart(item.item_code, item.serial_no); - this.search.$input.val(""); + me.search.$input.val(""); return; } else if (item.barcode) { me.add_to_cart(item.item_code); - this.search.$input.val(""); + me.search.$input.val(""); return; } } diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 28bfb5a184..f64dec6d77 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -109,6 +109,7 @@ "fieldname": "barcode", "fieldtype": "Data", "label": "Barcode", + "no_copy": 1, "permlevel": 0, "read_only": 0 }, @@ -876,7 +877,7 @@ "icon": "icon-tag", "idx": 1, "max_attachments": 1, - "modified": "2015-02-25 02:46:14.483577", + "modified": "2015-03-02 07:48:53.411086", "modified_by": "Administrator", "module": "Stock", "name": "Item",