fix: Server side validation for missing payment gateway account

This commit is contained in:
marination 2021-02-11 19:06:10 +05:30
parent 8615227090
commit e2d0715cdf

View File

@ -462,6 +462,9 @@ def get_party(user=None):
return customer return customer
def get_debtors_account(cart_settings): def get_debtors_account(cart_settings):
if not cart_settings.payment_gateway_account:
frappe.throw(_("Payment Gateway Account not set"), _("Mandatory"))
payment_gateway_account_currency = \ payment_gateway_account_currency = \
frappe.get_doc("Payment Gateway Account", cart_settings.payment_gateway_account).currency frappe.get_doc("Payment Gateway Account", cart_settings.payment_gateway_account).currency