diff --git a/frappe/public/js/frappe/model/sync.js b/frappe/public/js/frappe/model/sync.js index 829ee5753d..6dd2433fc6 100644 --- a/frappe/public/js/frappe/model/sync.js +++ b/frappe/public/js/frappe/model/sync.js @@ -8,14 +8,14 @@ $.extend(frappe.model, { extract docs, docinfo (attachments, comments, assignments) from incoming request and set in `locals` and `frappe.model.docinfo` */ - + var isPlain; if(!r.docs && !r.docinfo) r = {docs:r}; - if($.isPlainObject(r.docs)) r.docs = [r.docs]; + isPlain = $.isPlainObject(r.docs); + if(isPlain) r.docs = [r.docs]; if(r.docs) { var last_parent_name = null; - var dirty = []; for(var i=0, l=r.docs.length; i