Skip to content

Commit

Permalink
fix: Remove validation from Journal Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed May 15, 2022
1 parent 33d9767 commit 5b87264
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
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,
Expand Down Expand Up @@ -48,7 +48,6 @@ def validate(self):
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()
Expand Down Expand Up @@ -343,20 +342,6 @@ def validate_party(self):
)
)

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(
Expand Down

0 comments on commit 5b87264

Please sign in to comment.