fixes in barcode
This commit is contained in:
parent
b2f550ccb3
commit
d015195617
@ -105,6 +105,15 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
},
|
||||
|
||||
barcode: function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.barcode=="" || d.barcode==null) {
|
||||
// barcode cleared, remove item
|
||||
d.item_code = "";
|
||||
}
|
||||
this.item_code(doc, cdt, cdn);
|
||||
},
|
||||
|
||||
item_code: function(doc, cdt, cdn) {
|
||||
var me = this;
|
||||
var item = frappe.get_doc(cdt, cdn);
|
||||
|
@ -124,15 +124,6 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
this.apply_pricing_rule();
|
||||
},
|
||||
|
||||
barcode: function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.barcode=="" || d.barcode==null) {
|
||||
// barcode cleared, remove item
|
||||
d.item_code = "";
|
||||
}
|
||||
this.item_code(doc, cdt, cdn);
|
||||
},
|
||||
|
||||
selling_price_list: function() {
|
||||
this.apply_price_list();
|
||||
},
|
||||
|
@ -204,18 +204,3 @@ frappe.ui.form.on("Purchase Receipt", "is_subcontracted", function(frm) {
|
||||
}
|
||||
frm.toggle_reqd("supplier_warehouse", frm.doc.is_subcontracted==="Yes");
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user