From 8e1a96e6de1d2001719fdd8c1dcf20d67cb809e0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Jan 2014 16:08:43 +0530 Subject: [PATCH] Load extra doctypes while building filter conditions --- webnotes/widgets/reportview.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webnotes/widgets/reportview.py b/webnotes/widgets/reportview.py index c6c7ffe97b..656d2fa21d 100644 --- a/webnotes/widgets/reportview.py +++ b/webnotes/widgets/reportview.py @@ -169,12 +169,14 @@ def build_filter_conditions(filters, conditions): if isinstance(f, basestring): conditions.append(f) else: + tname = ('`tab' + f[0] + '`') if not tname in webnotes.local.reportview_tables: webnotes.local.reportview_tables.append(tname) - if not hasattr(webnotes.local, "reportview_doctypes"): - load_doctypes() + if not hasattr(webnotes.local, "reportview_doctypes") \ + or not webnotes.local.reportview_doctypes.has_key(tname): + load_doctypes() # prepare in condition if f[2] in ['in', 'not in']: