[pos] [barcode] fixes #2831

This commit is contained in:
Rushabh Mehta 2015-03-02 18:25:14 +05:30
parent 8c84fca182
commit b83fa3bc2d
3 changed files with 5 additions and 4 deletions

View File

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

View File

@ -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;
}
}

View File

@ -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",