[minor] [for territory] auto add default For Territory in a new Tax Master, Shipping Rule and Price List

This commit is contained in:
Anand Doshi
2013-07-15 18:09:43 +05:30
parent 4563ef3aea
commit 1ffc5b576c
4 changed files with 132 additions and 114 deletions

View File

@@ -39,5 +39,14 @@ $.extend(erpnext, {
cur_frm.toggle_display("company", false);
}
}
}
},
add_for_territory: function() {
if(cur_frm.doc.__islocal &&
wn.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) {
var territory = wn.model.add_child(cur_frm.doc, "For Territory",
"valid_for_territories");
territory.territory = wn.defaults.get_default("territory");
}
},
});