[fix] [patch] check in_list_view for Custom DocTypes

This commit is contained in:
Anand Doshi 2013-07-17 12:36:07 +05:30
parent 08352ca0a9
commit 55da1ff98a
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import webnotes
from webnotes.model import no_value_fields
def execute():
for dt in webnotes.conn.sql("""select name from `tabDocType` where custom=1"""):
dtbean = webnotes.bean("DocType", dt)
if any((df.in_list_view for df in dtbean.doclist.get({"doctype": "DocField", "parent": dt}))):
continue
i = 0
for df in dtbean.doclist.get({"doctype": "DocField", "parent": dt}):
if i > 5:
break
if df.fieldtype not in no_value_fields:
df.in_list_view = 1
i += 1
if i > 0:
dtbean.save()

View File

@ -252,4 +252,5 @@ patch_list = [
"patches.july_2013.p03_cost_center_company",
"execute:webnotes.bean('Style Settings').save() #2013-07-16",
"patches.july_2013.p04_merge_duplicate_leads",
"patches.july_2013.p05_custom_doctypes_in_list_view",
]