fix: Remove validation from Journal Entry

This commit is contained in:
Deepesh Garg 2022-05-15 21:10:52 +05:30
parent 33d9767382
commit 5b8726405d

View File

@ -16,7 +16,7 @@ from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import (
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import (
get_party_tax_withholding_details,
)
from erpnext.accounts.party import get_party_account, get_party_gle_currency
from erpnext.accounts.party import get_party_account
from erpnext.accounts.utils import (
get_account_currency,
get_balance_on,
@ -48,7 +48,6 @@ class JournalEntry(AccountsController):
self.clearance_date = None
self.validate_party()
self.validate_party_account_currency()
self.validate_entries_for_advance()
self.validate_multi_currency()
self.set_amounts_in_company_currency()
@ -343,20 +342,6 @@ class JournalEntry(AccountsController):
)
)
def validate_party_account_currency(self):
for d in self.get("accounts"):
if d.party_type in ("Customer", "Supplier"):
party_gle_currency = get_party_gle_currency(d.party_type, d.party, self.company)
party_account_currency = get_account_currency(d.account)
party_currency = frappe.db.get_value(d.party_type, d.party, "default_currency")
if not party_gle_currency and (party_account_currency != party_currency):
frappe.throw(
_("Party Account {0} currency and default party currency should be same").format(
frappe.bold(d.account)
)
)
def check_credit_limit(self):
customers = list(
set(