add select type link fields in permission control

This commit is contained in:
Anand Doshi 2012-04-03 13:49:14 +05:30
parent e9c505608a
commit fc8bf7b1d8

View File

@ -70,7 +70,10 @@ class DocType:
ret.append(p)
# fields list
fl = ['', 'owner'] + [l[0] for l in sql("select fieldname from tabDocField where parent=%s and fieldtype='Link' and ifnull(options,'')!=''", doctype)]
fl = ['', 'owner'] + [l[0] for l in sql("""\
select fieldname from tabDocField where parent=%s
and ((fieldtype='Link' and ifnull(options,'')!='') or
(fieldtype='Select') and lcase(ifnull(options,'')) like 'link:%%')""", doctype)]
return {'perms':ret, 'fields':fl}