diff --git a/frappe/www/list.py b/frappe/www/list.py index 0d948f3ee4..4a1a56ebde 100644 --- a/frappe/www/list.py +++ b/frappe/www/list.py @@ -123,15 +123,19 @@ def get_list_context(context, doctype): from frappe.website.doctype.web_form.web_form import get_web_form_list list_context = context or frappe._dict() - module = load_doctype_module(doctype) - if hasattr(module, "get_list_context"): - out = frappe._dict(module.get_list_context(list_context) or {}) - if out: - list_context = out + meta = frappe.get_meta(doctype) + + if not meta.custom: + # custom doctypes don't have modules + module = load_doctype_module(doctype) + if hasattr(module, "get_list_context"): + out = frappe._dict(module.get_list_context(list_context) or {}) + if out: + list_context = out # get path from '/templates/' folder of the doctype if not list_context.row_template: - list_context.row_template = frappe.get_meta(doctype).get_row_template() + list_context.row_template = meta.get_row_template() # is web form, show the default web form filters # which is only the owner