Merge pull request #6289 from KanchanChauhan/barcode-in-stock-reconciliation

Barcode added to Stock Reconciliation
This commit is contained in:
Nabin Hait 2016-09-06 17:06:06 +05:30 committed by GitHub
commit 06792a93cd
2 changed files with 45 additions and 2 deletions

View File

@ -78,10 +78,27 @@ frappe.ui.form.on("Stock Reconciliation", {
}
});
}
}
},
set_item_code: function(doc, cdt, cdn) {
var d = frappe.model.get_doc(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);
}
}
});
}
}
});
frappe.ui.form.on("Stock Reconciliation Item", {
barcode: function(frm, cdt, cdn) {
frm.events.set_item_code(frm, cdt, cdn);
},
warehouse: function(frm, cdt, cdn) {
frm.events.set_valuation_rate_and_qty(frm, cdt, cdn);
},

View File

@ -10,6 +10,32 @@
"document_type": "Other",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "barcode",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Barcode",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -285,7 +311,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-08-26 02:15:26.109664",
"modified": "2016-09-05 07:10:19.571562",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation Item",