conversion rate fixes
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index fd99d80..0045177 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -46,14 +46,19 @@
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 c8b2b64..a3f1eca 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -75,7 +75,6 @@
callback: function(r) {
if(!r.exc) {
me.frm.set_value("taxes", r.message);
- me.calculate_taxes_and_totals();
}
}
});