Fix: Payment Entry party validation issue (#27022)
Co-authored-by: Subin Tom <subin-home@Subins-MacBook-Air.local> Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
This commit is contained in:
@@ -286,6 +286,7 @@ def validate_party_gle_currency(party_type, party, company, party_account_curren
|
|||||||
.format(frappe.bold(party_type), frappe.bold(party), frappe.bold(existing_gle_currency), frappe.bold(company)), InvalidAccountCurrency)
|
.format(frappe.bold(party_type), frappe.bold(party), frappe.bold(existing_gle_currency), frappe.bold(company)), InvalidAccountCurrency)
|
||||||
|
|
||||||
def validate_party_accounts(doc):
|
def validate_party_accounts(doc):
|
||||||
|
|
||||||
companies = []
|
companies = []
|
||||||
|
|
||||||
for account in doc.get("accounts"):
|
for account in doc.get("accounts"):
|
||||||
@@ -446,6 +447,10 @@ def get_payment_terms_template(party_name, party_type, company=None):
|
|||||||
return template
|
return template
|
||||||
|
|
||||||
def validate_party_frozen_disabled(party_type, party_name):
|
def validate_party_frozen_disabled(party_type, party_name):
|
||||||
|
|
||||||
|
if frappe.flags.ignore_party_validation:
|
||||||
|
return
|
||||||
|
|
||||||
if party_type and party_name:
|
if party_type and party_name:
|
||||||
if party_type in ("Customer", "Supplier"):
|
if party_type in ("Customer", "Supplier"):
|
||||||
party = frappe.get_cached_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True)
|
party = frappe.get_cached_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True)
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ def reconcile_against_document(args):
|
|||||||
# cancel advance entry
|
# cancel advance entry
|
||||||
doc = frappe.get_doc(d.voucher_type, d.voucher_no)
|
doc = frappe.get_doc(d.voucher_type, d.voucher_no)
|
||||||
|
|
||||||
|
frappe.flags.ignore_party_validation = True
|
||||||
doc.make_gl_entries(cancel=1, adv_adj=1)
|
doc.make_gl_entries(cancel=1, adv_adj=1)
|
||||||
|
|
||||||
# update ref in advance entry
|
# update ref in advance entry
|
||||||
@@ -361,6 +362,7 @@ def reconcile_against_document(args):
|
|||||||
# re-submit advance entry
|
# re-submit advance entry
|
||||||
doc = frappe.get_doc(d.voucher_type, d.voucher_no)
|
doc = frappe.get_doc(d.voucher_type, d.voucher_no)
|
||||||
doc.make_gl_entries(cancel = 0, adv_adj =1)
|
doc.make_gl_entries(cancel = 0, adv_adj =1)
|
||||||
|
frappe.flags.ignore_party_validation = False
|
||||||
|
|
||||||
if d.voucher_type in ('Payment Entry', 'Journal Entry'):
|
if d.voucher_type in ('Payment Entry', 'Journal Entry'):
|
||||||
doc.update_expense_claim()
|
doc.update_expense_claim()
|
||||||
|
|||||||
Reference in New Issue
Block a user