diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index fd99d806008..00451773a4b 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -46,14 +46,19 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({ var company_currency = this.get_company_currency(); if(!this.frm.doc.conversion_rate) { - frappe.throw(repl('%(conversion_rate_label)s' + - __(' is mandatory. Maybe Currency Exchange record is not created for ') + - '%(from_currency)s' + __(" to ") + '%(to_currency)s', - { - "conversion_rate_label": conversion_rate_label, - "from_currency": this.frm.doc.currency, - "to_currency": company_currency - })); + if(this.frm.doc.currency == company_currency) { + this.frm.set_value("conversion_rate", 1); + } else { + frappe.throw(repl('%(conversion_rate_label)s' + + __(' is mandatory. Maybe Currency Exchange record is not created for ') + + '%(from_currency)s' + __(" to ") + '%(to_currency)s', + { + "conversion_rate_label": conversion_rate_label, + "from_currency": this.frm.doc.currency, + "to_currency": company_currency + })); + } + } }, diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index c8b2b64684f..a3f1ecae9c9 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -75,7 +75,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ callback: function(r) { if(!r.exc) { me.frm.set_value("taxes", r.message); - me.calculate_taxes_and_totals(); } } });