|
|
@@ -298,7 +298,7 @@ _f.Frm.prototype.setup_meta = function(doctype) { |
|
|
|
if(this.meta.istable) { this.meta.in_dialog = 1 } |
|
|
|
} |
|
|
|
|
|
|
|
_f.Frm.prototype.refresh_header = function() { |
|
|
|
_f.Frm.prototype.refresh_header = function(is_a_different_doc) { |
|
|
|
// set title |
|
|
|
// main title |
|
|
|
if(!this.meta.in_dialog || this.in_form) { |
|
|
@@ -310,6 +310,10 @@ _f.Frm.prototype.refresh_header = function() { |
|
|
|
|
|
|
|
// show / hide buttons |
|
|
|
if(this.toolbar) { |
|
|
|
if (is_a_different_doc) { |
|
|
|
this.toolbar.current_status = undefined; |
|
|
|
} |
|
|
|
|
|
|
|
this.toolbar.refresh(); |
|
|
|
} |
|
|
|
|
|
|
@@ -341,8 +345,10 @@ _f.Frm.prototype.check_doc_perm = function() { |
|
|
|
} |
|
|
|
|
|
|
|
_f.Frm.prototype.refresh = function(docname) { |
|
|
|
// record switch |
|
|
|
var is_a_different_doc = docname ? true : false; |
|
|
|
|
|
|
|
if(docname) { |
|
|
|
// record switch |
|
|
|
if(this.docname != docname && (!this.meta.in_dialog || this.in_form) && |
|
|
|
!this.meta.istable) { |
|
|
|
scroll(0, 0); |
|
|
@@ -388,7 +394,7 @@ _f.Frm.prototype.refresh = function(docname) { |
|
|
|
cur_frm.cscript.is_onload = true; |
|
|
|
this.setnewdoc(); |
|
|
|
} else { |
|
|
|
this.render_form(); |
|
|
|
this.render_form(is_a_different_doc); |
|
|
|
} |
|
|
|
|
|
|
|
// if print format is shown, refresh the format |
|
|
@@ -398,7 +404,7 @@ _f.Frm.prototype.refresh = function(docname) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
_f.Frm.prototype.render_form = function() { |
|
|
|
_f.Frm.prototype.render_form = function(is_a_different_doc) { |
|
|
|
if(!this.meta.istable) { |
|
|
|
this.layout.doc = this.doc; |
|
|
|
this.layout.attach_doc_and_docfields() |
|
|
@@ -410,7 +416,7 @@ _f.Frm.prototype.render_form = function() { |
|
|
|
|
|
|
|
// header must be refreshed before client methods |
|
|
|
// because add_custom_button |
|
|
|
this.refresh_header(); |
|
|
|
this.refresh_header(is_a_different_doc); |
|
|
|
|
|
|
|
// call trigger |
|
|
|
this.script_manager.trigger("refresh"); |
|
|
@@ -438,7 +444,7 @@ _f.Frm.prototype.render_form = function() { |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.refresh_header(); |
|
|
|
this.refresh_header(is_a_different_doc); |
|
|
|
} |
|
|
|
|
|
|
|
$(cur_frm.wrapper).trigger('render_complete'); |
|
|
|