diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index fa4333ab47e6..0f087d485418 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2651,7 +2651,7 @@ def get_advance_journal_entries( if order_list: q = q.where( - (journal_acc.reference_type == order_doctype) & ((journal_acc.reference_type).isin(order_list)) + (journal_acc.reference_type == order_doctype) & ((journal_acc.reference_name).isin(order_list)) ) q = q.orderby(journal_entry.posting_date)