[fix] [minor] call dirty when synced with local doclist

This commit is contained in:
Nabin Hait 2013-08-14 14:41:08 +05:30
parent 064fc47184
commit e240df5bb3

View file

@ -17,12 +17,15 @@ $.extend(wn.model, {
wn.model.clear_doclist(doclist[0].doctype, doclist[0].name)
var last_parent_name = null;
var dirty = [];
$.each(doclist, function(i, d) {
if(!d.name && d.__islocal) { // get name (local if required)
d.name = wn.model.get_new_name(d.doctype);
wn.provide("wn.model.docinfo." + d.doctype + "." + d.name);
if(!d.parenttype)
last_parent_name = d.name;
if(!dirty.indexOf(d.parenttype || d.doctype)) dirty.push(d.parenttype || d.doctype);
}
// set parent for subsequent orphans
@ -64,6 +67,8 @@ $.extend(wn.model, {
wn.model.docinfo[doc.doctype][doc.name] = r.docinfo;
}
if(cur_frm && dirty.indexOf(cur_frm.doctype)) cur_frm.dirty();
return doclist;
},