Merge pull request #1266 from anandpdoshi/fix-socket-new-doc
bind form-rename to subscribe doc after rename of a new doc
This commit is contained in:
commit
5a03cefb96
2 changed files with 7 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ frappe.socket = {
|
|||
|
||||
frappe.socket.setup_listeners();
|
||||
frappe.socket.setup_reconnect();
|
||||
$(document).on('form-load', function(e, frm) {
|
||||
|
||||
$(document).on('form-load form-rename', function(e, frm) {
|
||||
if (frm.is_new()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,6 +402,11 @@ _f.Frm.prototype.refresh = function(docname) {
|
|||
})
|
||||
} else {
|
||||
this.render_form(is_a_different_doc);
|
||||
if (this.doc.localname) {
|
||||
// trigger form-rename and remove .localname
|
||||
delete this.doc.localname;
|
||||
$(document).trigger("form-rename", [this]);
|
||||
}
|
||||
}
|
||||
|
||||
// if print format is shown, refresh the format
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue