fix: list index out of range error while setting POS payment mode (#23018)

This commit is contained in:
Rucha Mahabal 2020-08-14 17:11:39 +05:30 committed by GitHub
parent 404afb823f
commit 5fb0e7184e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1621,8 +1621,9 @@ def update_multi_mode_option(doc, pos_profile):
pos_payment_method = pos_payment_method.as_dict()
payment_mode = get_mode_of_payment_info(pos_payment_method.mode_of_payment, doc.company)
payment_mode[0].default = pos_payment_method.default
append_payment(payment_mode[0])
if payment_mode:
payment_mode[0].default = pos_payment_method.default
append_payment(payment_mode[0])
def get_all_mode_of_payments(doc):
return frappe.db.sql("""