Merge pull request #31566 from deepeshgarg007/ignore_account_currency

fix: Allow multi currency invoice against single party account
This commit is contained in:
Deepesh Garg
2022-07-11 21:14:02 +05:30
committed by GitHub
2 changed files with 17 additions and 2 deletions

View File

@@ -1472,8 +1472,15 @@ class AccountsController(TransactionBase):
self.get("debit_to") if self.doctype == "Sales Invoice" else self.get("credit_to")
)
party_account_currency = get_account_currency(party_account)
allow_multi_currency_invoices_against_single_party_account = frappe.db.get_singles_value(
"Accounts Settings", "allow_multi_currency_invoices_against_single_party_account"
)
if not party_gle_currency and (party_account_currency != self.currency):
if (
not party_gle_currency
and (party_account_currency != self.currency)
and not allow_multi_currency_invoices_against_single_party_account
):
frappe.throw(
_("Party Account {0} currency ({1}) and document currency ({2}) should be same").format(
frappe.bold(party_account), party_account_currency, self.currency