Barcode added to stock entry
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 716b4a8..7a5add6 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -426,7 +426,21 @@
}
});
}
+}
+cur_frm.cscript.barcode = function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ if (d.barcode) {
+ frappe.call({
+ method: "erpnext.stock.get_item_details.get_item_code",
+ args: {"barcode": d.barcode },
+ callback: function(r) {
+ if (!r.exe){
+ frappe.model.set_value(cdt, cdn, "item_code", r.message);
+ }
+ }
+ });
+ }
}
cur_frm.cscript.s_warehouse = function(doc, cdt, cdn) {
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
index 750e7d6..fb654c2 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
@@ -5,6 +5,19 @@
"doctype": "DocType",
"fields": [
{
+ "fieldname": "barcode",
+ "fieldtype": "Data",
+ "label": "Barcode",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "section_break_2",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "s_warehouse",
"fieldtype": "Link",
"in_filter": 1,
@@ -331,7 +344,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2015-02-19 05:33:06.289852",
+ "modified": "2015-02-25 04:31:21.801200",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry Detail",
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 52cb5ac..4d03106 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -96,6 +96,7 @@
return args
+@frappe.whitelist()
def get_item_code(barcode=None, serial_no=None):
if barcode:
item_code = frappe.db.get_value("Item", {"barcode": barcode})