Ver a proveniência

fixes in get_child_fields included custom child tables

version-14
Nabin Hait há 13 anos
ascendente
cometimento
e8e9fd9f0c
2 ficheiros alterados com 7 adições e 4 eliminações
  1. +1
    -1
      py/webnotes/model/doc.py
  2. +6
    -3
      py/webnotes/model/meta.py

+ 1
- 1
py/webnotes/model/doc.py Ver ficheiro

@@ -736,4 +736,4 @@ def getsingle(doctype):
"""get single doc as dict"""
dataset = webnotes.conn.sql("select field, value from tabSingles where doctype=%s", doctype)
return dict(dataset)

+ 6
- 3
py/webnotes/model/meta.py Ver ficheiro

@@ -67,7 +67,10 @@ def get_link_fields(doctype):
#=================================================================================

def get_table_fields(doctype):
return webnotes.conn.sql("select options, fieldname from tabDocField \
where parent='%s' and fieldtype='Table'" % doctype, as_list=1)

child_tables = [[d[0], d[1]] for d in webnotes.conn.sql("select options, fieldname from tabDocField \
where parent='%s' and fieldtype='Table'" % doctype, as_list=1)]
custom_child_tables = [[d[0], d[1]] for d in webnotes.conn.sql("select options, fieldname from `tabCustom Field` \
where dt='%s' and fieldtype='Table'" % doctype, as_list=1)]

return child_tables + custom_child_tables

Carregando…
Cancelar
Guardar