fixed default tax fetch issue

This commit is contained in:
Anand Doshi 2012-06-13 14:20:24 +05:30
parent 61ade3d486
commit 7deaff1979
2 changed files with 8 additions and 3 deletions

View File

@ -30,7 +30,7 @@ cur_frm.cscript.load_taxes = function(doc, cdt, cdn, callback) {
callback(doc, cdt, cdn);
}
} else {
$c_obj([doc],'load_default_taxes','',function(r,rt){
$c_obj(make_doclist(doc.doctype, doc.name),'load_default_taxes','',function(r,rt){
refresh_field('other_charges');
if(callback) callback(doc, cdt, cdn);
});
@ -72,6 +72,8 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
cur_frm.cscript.load_defaults(doc, dt, dn, callback);
}
});
} else {
cur_frm.cscript.load_taxes(doc, dt, dn, callback);
}
}

View File

@ -214,6 +214,9 @@ class DocType(TransactionBase):
# Load Default Taxes
# ====================
def load_default_taxes(self, obj):
if cstr(obj.doc.charge):
self.get_other_charges(obj)
else:
self.get_other_charges(obj, 1)