mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
added onload_post_render
This commit is contained in:
@@ -9,10 +9,13 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
if (!doc.transaction_date) doc.transaction_date = dateutil.obj_to_str(new Date())
|
||||
if (!doc.status) doc.status = 'Draft';
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
|
||||
// second call
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_item_defaults(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.get_item_defaults = function(doc) {
|
||||
|
||||
@@ -15,16 +15,18 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
if(!doc.currency) doc.currency = sys_defaults.currency;
|
||||
if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'});
|
||||
if(!doc.transaction_date) set_multiple(cdt,cdn,{transaction_date:get_today()});
|
||||
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_default_schedule_date(doc);
|
||||
}
|
||||
|
||||
if(doc.__islocal){
|
||||
hide_field(['supplier_name','supplier_address','contact_person','address_display','contact_display','contact_mobile','contact_email']);
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_default_schedule_date(doc);
|
||||
}
|
||||
}
|
||||
|
||||
// ================================== Refresh ==========================================
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user