diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 8a0c669fd6..6612cb563e 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -375,8 +375,6 @@ def validate_taxes_and_charges(tax): if tax.charge_type == "Actual": tax.rate = None - if not tax.tax_amount: - frappe.throw(_("Amount is mandatory for charge type 'Actual'")) def validate_inclusive_tax(tax, doc): def _on_previous_row_error(row_range): diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js index 212d2ae4f1..fc87b23a62 100644 --- a/erpnext/public/js/controllers/accounts.js +++ b/erpnext/public/js/controllers/accounts.js @@ -36,25 +36,8 @@ frappe.ui.form.on(cur_frm.doctype, { }, validate: function(frm) { // neither is absolutely mandatory - // check mandatory based on charge_type frm.get_docfield("taxes", "rate").reqd = 0; frm.get_docfield("taxes", "tax_amount").reqd = 0; - - $.each(frm.doc.taxes || [], function(i, d) { - if(d.charge_type==="Actual") { - d.rate = 0; - if(!d.tax_amount) { - msgprint(__("Amount is mandatory for {0}", [d.account_head])); - validated = false; - } - } else { - d.tax_amount = 0; - if(!d.rate) { - msgprint(__("Rate is mandatory for {0}", [d.account_head])); - validated = false; - } - } - }); }, taxes_on_form_rendered: function(frm) { erpnext.taxes.set_conditional_mandatory_rate_or_amount(frm);