[minor] [cleanup] frappe.model.clear_doc (js)
This commit is contained in:
parent
b0ac972fbd
commit
04d90f8f0c
1 changed files with 4 additions and 2 deletions
|
|
@ -322,6 +322,7 @@ $.extend(frappe.model, {
|
|||
},
|
||||
|
||||
get_doc: function(doctype, name) {
|
||||
if(!name) name = doctype;
|
||||
if($.isPlainObject(name)) {
|
||||
var doc = frappe.get_list(doctype, name);
|
||||
return doc && doc.length ? doc[0] : null;
|
||||
|
|
@ -384,6 +385,9 @@ $.extend(frappe.model, {
|
|||
parent_doc[parentfield] = newlist;
|
||||
});
|
||||
}
|
||||
|
||||
if(frappe.ui.toolbar.recent)
|
||||
frappe.ui.toolbar.recent.remove(doctype, docname);
|
||||
},
|
||||
|
||||
get_no_copy_list: function(doctype) {
|
||||
|
|
@ -409,8 +413,6 @@ $.extend(frappe.model, {
|
|||
callback: function(r, rt) {
|
||||
if(!r.exc) {
|
||||
frappe.model.clear_doc(doctype, docname);
|
||||
if(frappe.ui.toolbar.recent)
|
||||
frappe.ui.toolbar.recent.remove(doctype, docname);
|
||||
if(callback) callback(r,rt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue