mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
refactored javascript models
This commit is contained in:
@@ -71,9 +71,9 @@ cur_frm.cscript['Make Maintenance Visit'] = function() {
|
||||
$c_obj(make_doclist(doc.doctype, doc.name),'check_maintenance_visit','',
|
||||
function(r,rt){
|
||||
if(r.message == 'No'){
|
||||
n = createLocal("Maintenance Visit");
|
||||
n = wn.model.make_new_doc_and_get_name("Maintenance Visit");
|
||||
$c('dt_map', args={
|
||||
'docs':compress_doclist([locals["Maintenance Visit"][n]]),
|
||||
'docs':wn.model.compress([locals["Maintenance Visit"][n]]),
|
||||
'from_doctype':'Customer Issue',
|
||||
'to_doctype':'Maintenance Visit',
|
||||
'from_docname':doc.name,
|
||||
|
||||
@@ -116,7 +116,7 @@ cur_frm.cscript.periodicity = function(doc, cdt, cdn){
|
||||
|
||||
cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) {
|
||||
if (!doc.__islocal) {
|
||||
$c('runserverobj', args={'method':'generate_schedule', 'docs':compress_doclist(make_doclist(cdt,cdn))},
|
||||
$c('runserverobj', args={'method':'generate_schedule', 'docs':wn.model.compress(make_doclist(cdt,cdn))},
|
||||
function(r,rt){
|
||||
refresh_field('maintenance_schedule_detail');
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
|
||||
$.extend(cur_frm.cscript, {
|
||||
onload: function(doc, dt, dn) {
|
||||
cur_frm.last_reload = new Date();
|
||||
if(in_list(user_roles,'System Manager')) {
|
||||
cur_frm.page_layout.footer.help_area.innerHTML = '<hr>\
|
||||
<p><a href="#Form/Email Settings/Email Settings">Email Settings</a><br>\
|
||||
@@ -27,11 +26,6 @@ $.extend(cur_frm.cscript, {
|
||||
},
|
||||
|
||||
refresh: function(doc) {
|
||||
if(new Date() - cur_frm.last_reload > 20000) {
|
||||
cur_frm.last_reload = new Date();
|
||||
cur_frm.reload_doc();
|
||||
return;
|
||||
}
|
||||
erpnext.hide_naming_series();
|
||||
cur_frm.cscript.make_listing(doc);
|
||||
if(!doc.__islocal) {
|
||||
|
||||
Reference in New Issue
Block a user