diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index a4719119e83..ac0287d05a5 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -216,12 +216,17 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ // barcode cleared, remove item d.item_code = ""; } - this.item_code(doc, cdt, cdn); + this.item_code(doc, cdt, cdn, true); }, - item_code: function(doc, cdt, cdn) { + item_code: function(doc, cdt, cdn, from_barcode) { var me = this; var item = frappe.get_doc(cdt, cdn); + + // clear barcode if setting item (else barcode will take priority) + if(!from_barcode) { + item.barcode = null; + } if(item.item_code || item.barcode || item.serial_no) { if(!this.validate_company_and_party()) { cur_frm.fields_dict["items"].grid.grid_rows[item.idx - 1].remove(); diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 9f2c60c2dae..2d6dae205a6 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -144,6 +144,30 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 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": 1, + "permlevel": 0, + "print_hide": 0, + "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, @@ -406,30 +430,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 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": 1, - "permlevel": 0, - "print_hide": 0, - "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, @@ -2228,8 +2228,8 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2016-05-12 15:33:02.407671", - "modified_by": "umair@erpnext.com", + "modified": "2016-06-02 14:48:46.128121", + "modified_by": "Administrator", "module": "Stock", "name": "Item", "owner": "Administrator",