Merge pull request #2866 from neilLasrado/barcode
Barcode added to stock entry
This commit is contained in:
commit
b7ae9b4283
@ -80,7 +80,8 @@ erpnext.feature_setup.feature_dict = {
|
|||||||
'fs_item_barcode': {
|
'fs_item_barcode': {
|
||||||
'Item': {'fields': ['barcode']},
|
'Item': {'fields': ['barcode']},
|
||||||
'Delivery Note': {'items': ['barcode']},
|
'Delivery Note': {'items': ['barcode']},
|
||||||
'Sales Invoice': {'items': ['barcode']}
|
'Sales Invoice': {'items': ['barcode']},
|
||||||
|
'Stock Entry': {'items': ['barcode']}
|
||||||
},
|
},
|
||||||
'fs_item_group_in_details': {
|
'fs_item_group_in_details': {
|
||||||
'Delivery Note': {'items':['item_group']},
|
'Delivery Note': {'items':['item_group']},
|
||||||
|
@ -426,7 +426,21 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
cur_frm.cscript.s_warehouse = function(doc, cdt, cdn) {
|
||||||
|
@ -4,6 +4,19 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"fields": [
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "barcode",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Barcode",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_2",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "s_warehouse",
|
"fieldname": "s_warehouse",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@ -331,7 +344,7 @@
|
|||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"modified": "2015-02-19 05:33:06.289852",
|
"modified": "2015-02-25 04:31:21.801200",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Entry Detail",
|
"name": "Stock Entry Detail",
|
||||||
|
@ -96,6 +96,7 @@ def process_args(args):
|
|||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
def get_item_code(barcode=None, serial_no=None):
|
def get_item_code(barcode=None, serial_no=None):
|
||||||
if barcode:
|
if barcode:
|
||||||
item_code = frappe.db.get_value("Item", {"barcode": barcode})
|
item_code = frappe.db.get_value("Item", {"barcode": barcode})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user