diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 59a6782f58..60eb770076 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -309,12 +309,12 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup return get_tax_template(posting_date, args) -def validate_party_frozen_disabled(party, party_type): - if party_type and party: - party = frappe.db.get_value(party_type, party, ["is_frozen", "disabled"], as_dict=True) +def validate_party_frozen_disabled(party_name, party_type): + if party_type and party_name: + party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True) if party.disabled: - frappe.throw("{0} {1} is disabled".format(party_type, party), PartyDisabled) + frappe.throw("{0} {1} is disabled".format(party_type, party_name), PartyDisabled) elif party.is_frozen: frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier') if not frozen_accounts_modifier in frappe.get_roles(): - frappe.throw("{0} {1} is frozen".format(party_type, party), PartyFrozen) + frappe.throw("{0} {1} is frozen".format(party_type, party_name), PartyFrozen)