copy expense account to all row if entered in one

This commit is contained in:
Nabin Hait
2013-03-26 15:24:56 +05:30
parent e28efd8dc8
commit 495db08104
2 changed files with 21 additions and 7 deletions

View File

@@ -310,6 +310,17 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
}
}
cur_frm.cscript.expense_account = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
if(d.expense_account) {
var cl = getchildren('Delivery Note Item', doc.name, cur_frm.cscript.fname, doc.doctype);
for(var i = 0; i < cl.length; i++){
if(!cl[i].expense_account) cl[i].expense_account = d.expense_account;
}
}
refresh_field(cur_frm.cscript.fname);
}
// expense account
cur_frm.fields_dict['delivery_note_details'].grid.get_field('expense_account').get_query = function(doc) {
return {