fixed asynchronus issue
This commit is contained in:
parent
237ac638f5
commit
2d8ac7f3f9
@ -22,16 +22,18 @@ cur_frm.cscript.onload = function(doc,dt,dn) {
|
||||
if(doc.__islocal){
|
||||
hide_field(['supplier_address', 'contact_person', 'supplier_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email']);
|
||||
}
|
||||
|
||||
// defined in purchase_common.js
|
||||
cur_frm.cscript.update_item_details(doc, cdt, cdn);
|
||||
}
|
||||
|
||||
|
||||
//Onload post render
|
||||
//------------------------
|
||||
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn);
|
||||
var callback = function(doc, dt, dn) {
|
||||
if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn);
|
||||
}
|
||||
|
||||
// defined in purchase_common.js
|
||||
cur_frm.cscript.update_item_details(doc, cdt, cdn, callback);
|
||||
}
|
||||
|
||||
// Refresh
|
||||
|
@ -33,7 +33,7 @@ cur_frm.cscript.load_defaults = function(doc, dt, dn) {
|
||||
}
|
||||
|
||||
// Update existing item details
|
||||
cur_frm.cscript.update_item_details = function(doc, dt, dn) {
|
||||
cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
|
||||
if(!cur_frm.doc.__islocal) { return; }
|
||||
var children = getchildren(cur_frm.cscript.tname, doc.name, cur_frm.cscript.fname);
|
||||
if(children) {
|
||||
@ -43,6 +43,7 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn) {
|
||||
refresh_field(cur_frm.cscript.fname);
|
||||
doc = locals[doc.doctype][doc.name];
|
||||
cur_frm.cscript.load_defaults(doc, dt, dn);
|
||||
if(callback) callback(doc, dt, dn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -20,14 +20,16 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
if(doc.supplier) unhide_field(['supplier_name','supplier_address','contact_person','address_display','contact_display','contact_mobile','contact_email']);
|
||||
|
||||
// defined in purchase_common.js
|
||||
cur_frm.cscript.update_item_details(doc, cdt, cdn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_default_schedule_date(doc);
|
||||
}
|
||||
var callback = function(doc, dt, dn) {
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_default_schedule_date(doc);
|
||||
}
|
||||
}
|
||||
// defined in purchase_common.js
|
||||
cur_frm.cscript.update_item_details(doc, cdt, cdn, callback);
|
||||
}
|
||||
|
||||
//========================== Refresh ===============================================================
|
||||
|
Loading…
Reference in New Issue
Block a user