[fix] [minor] updated message for conversion rate
This commit is contained in:
parent
06da1a6147
commit
e0b32824ff
@ -499,16 +499,18 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
this.frm.doc.conversion_rate = flt(this.frm.doc.conversion_rate, precision("conversion_rate"));
|
this.frm.doc.conversion_rate = flt(this.frm.doc.conversion_rate, precision("conversion_rate"));
|
||||||
var conversion_rate_label = wn.meta.get_label(this.frm.doc.doctype, "conversion_rate",
|
var conversion_rate_label = wn.meta.get_label(this.frm.doc.doctype, "conversion_rate",
|
||||||
this.frm.doc.name);
|
this.frm.doc.name);
|
||||||
|
|
||||||
if(this.frm.doc.conversion_rate == 0) {
|
|
||||||
wn.throw(wn._(conversion_rate_label) + " " + wn._("cannot be 0"));
|
|
||||||
}
|
|
||||||
|
|
||||||
var company_currency = this.get_company_currency();
|
var company_currency = this.get_company_currency();
|
||||||
|
|
||||||
if(!this.frm.doc.conversion_rate) {
|
if(!this.frm.doc.conversion_rate) {
|
||||||
wn.throw(wn._("Please enter valid") + " " + wn._(conversion_rate_label) +
|
var msg = $(repl('%(conversion_rate_label)s is mandatory. Maybe Currency Exchange \
|
||||||
" 1 " + this.frm.doc.currency + " = [?] " + company_currency);
|
record is not created for %(from_currency)s to %(to_currency)s',
|
||||||
|
{
|
||||||
|
"conversion_rate_label": conversion_rate_label,
|
||||||
|
"from_currency": self.doc.currency,
|
||||||
|
"to_currency": company_currency
|
||||||
|
}));
|
||||||
|
|
||||||
|
wn.throw(wn._(msg));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -426,15 +426,15 @@ def get_address_territory(address_doc):
|
|||||||
def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company):
|
def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company):
|
||||||
"""common validation for currency and price list currency"""
|
"""common validation for currency and price list currency"""
|
||||||
|
|
||||||
if conversion_rate == 0:
|
|
||||||
msgprint(conversion_rate_label + _(' cannot be 0'), raise_exception=True)
|
|
||||||
|
|
||||||
company_currency = webnotes.conn.get_value("Company", company, "default_currency")
|
company_currency = webnotes.conn.get_value("Company", company, "default_currency")
|
||||||
|
|
||||||
if not conversion_rate:
|
if not conversion_rate:
|
||||||
msgprint(_('Please enter valid ') + conversion_rate_label + (': ')
|
msgprint(_('%(conversion_rate_label)s is mandatory. Maybe Currency Exchange \
|
||||||
+ ("1 %s = [?] %s" % (currency, company_currency)),
|
record is not created for %(from_currency)s to %(to_currency)s') % {
|
||||||
raise_exception=True)
|
"conversion_rate_label": conversion_rate_label,
|
||||||
|
"from_currency": currency,
|
||||||
|
"to_currency": company_currency
|
||||||
|
}, raise_exception=True)
|
||||||
|
|
||||||
def validate_item_fetch(args, item):
|
def validate_item_fetch(args, item):
|
||||||
from stock.utils import validate_end_of_life
|
from stock.utils import validate_end_of_life
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user