fix: Taxes and charges table not clear the existing rows if the template is changed

This commit is contained in:
Rohit Waghchaure 2019-04-11 18:35:15 +05:30
parent 6472ed2c1e
commit 72cc37e8da
2 changed files with 310 additions and 136 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1389,14 +1389,17 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
args: {
"master_doctype": frappe.meta.get_docfield(this.frm.doc.doctype, "taxes_and_charges",
this.frm.doc.name).options,
"master_name": this.frm.doc.taxes_and_charges,
"master_name": this.frm.doc.taxes_and_charges
},
callback: function(r) {
if(!r.exc) {
for (let tax of r.message) {
me.frm.add_child("taxes", tax);
me.frm.set_value("taxes", r.message);
if(me.frm.doc.shipping_rule) {
me.frm.script_manager.trigger("shipping_rule");
} else {
me.calculate_taxes_and_totals();
}
me.calculate_taxes_and_totals();
}
}
});