[model] [with doc] get doclist from server if docinfo is missing
This commit is contained in:
parent
f1f2a7b740
commit
7d0180e64b
1 changed files with 5 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ $.extend(wn.model, {
|
|||
|
||||
with_doc: function(doctype, name, callback) {
|
||||
if(!name) name = doctype; // single type
|
||||
if(locals[doctype] && locals[doctype][name]) {
|
||||
if(locals[doctype] && locals[doctype][name] && wn.model.get_docinfo(doctype, name)) {
|
||||
callback(name);
|
||||
} else {
|
||||
wn.call({
|
||||
|
|
@ -118,6 +118,10 @@ $.extend(wn.model, {
|
|||
}
|
||||
},
|
||||
|
||||
get_docinfo: function(doctype, name) {
|
||||
return wn.model.docinfo[doctype] && wn.model.docinfo[doctype][name] || null;
|
||||
},
|
||||
|
||||
get_server_module_name: function(doctype) {
|
||||
var dt = wn.model.scrub(doctype)
|
||||
return wn.model.scrub(locals.DocType[doctype].module)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue