From 2f7b7b02acdfd95439e0b98d55cd766ebda1494b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Sat, 6 Jul 2019 13:40:02 +0530 Subject: [PATCH] fix: Retain list_context object (#7848) list_context object was lost between update_context_from_module calls --- frappe/www/list.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe/www/list.py b/frappe/www/list.py index 4362b5648c..c5be76e175 100644 --- a/frappe/www/list.py +++ b/frappe/www/list.py @@ -142,7 +142,7 @@ def prepare_filters(doctype, controller, kwargs): return filters -def get_list_context(context, doctype, web_form_name): +def get_list_context(context, doctype, web_form_name=None): from frappe.modules import load_doctype_module list_context = context or frappe._dict() @@ -155,17 +155,18 @@ def get_list_context(context, doctype, web_form_name): out = frappe._dict(module.get_list_context(list_context) or {}) if out: list_context = out + return list_context # get context from the doctype module if not meta.custom: # custom doctypes don't have modules module = load_doctype_module(doctype) - update_context_from_module(module, list_context) + list_context = update_context_from_module(module, list_context) # get context from web form module if web_form_name: web_form = frappe.get_doc('Web Form', web_form_name) - update_context_from_module(web_form.get_web_form_module(), list_context) + list_context = update_context_from_module(web_form.get_web_form_module(), list_context) # get path from '/templates/' folder of the doctype if not list_context.row_template: