Explorar el Código

fixes in get_child_fields included custom child tables

version-14
Nabin Hait hace 13 años
padre
commit
e8e9fd9f0c
Se han modificado 2 ficheros con 7 adiciones y 4 borrados
  1. +1
    -1
      py/webnotes/model/doc.py
  2. +6
    -3
      py/webnotes/model/meta.py

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

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

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

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


def get_table_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

Cargando…
Cancelar
Guardar