File tree Expand file tree Collapse file tree
accounts/doctype/sales_invoice Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1773,17 +1773,6 @@ def test_multi_currency_gle(self):
17731773
17741774 self .assertTrue (gle )
17751775
1776- def test_invoice_exchange_rate (self ):
1777- si = create_sales_invoice (
1778- customer = "_Test Customer USD" ,
1779- debit_to = "_Test Receivable USD - _TC" ,
1780- currency = "USD" ,
1781- conversion_rate = 1 ,
1782- do_not_save = 1 ,
1783- )
1784-
1785- self .assertRaises (frappe .ValidationError , si .save )
1786-
17871776 def test_invalid_currency (self ):
17881777 # Customer currency = USD
17891778
Original file line number Diff line number Diff line change @@ -2459,12 +2459,17 @@ def check_conversion_rate(self):
24592459 default_currency = erpnext .get_company_currency (self .company )
24602460 if not default_currency :
24612461 throw (_ ("Please enter default currency in Company Master" ))
2462- if (
2463- (self .currency == default_currency and flt (self .conversion_rate ) != 1.00 )
2464- or not self .conversion_rate
2465- or (self .currency != default_currency and flt (self .conversion_rate ) == 1.00 )
2466- ):
2467- throw (_ ("Conversion rate cannot be 0 or 1" ))
2462+
2463+ if not self .conversion_rate :
2464+ throw (_ ("Conversion rate cannot be 0" ))
2465+
2466+ if self .currency == default_currency and flt (self .conversion_rate ) != 1.00 :
2467+ throw (_ ("Conversion rate must be 1.00 if document currency is same as company currency" ))
2468+
2469+ if self .currency != default_currency and flt (self .conversion_rate ) == 1.00 :
2470+ frappe .msgprint (
2471+ _ ("Conversion rate is 1.00, but document currency is different from company currency" )
2472+ )
24682473
24692474 def check_finance_books (self , item , asset ):
24702475 if (
You can’t perform that action at this time.
0 commit comments