Browse Source

minor fix in get_property

version-14
Anand Doshi 12 years ago
parent
commit
e80c6f3cb1
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      webnotes/model/doctype.py

+ 2
- 1
webnotes/model/doctype.py View File

@@ -302,7 +302,8 @@ def get_property(dt, prop, fieldname=None):
"""get a doctype property"""
doctypelist = get(dt)
if fieldname:
return doctypelist.getone({"fieldname":fieldname}).fields.get(prop)
field = doctypelist.get_field(fieldname)
return field and field.fields.get(prop) or None
else:
return doctypelist[0].fields.get(prop)


Loading…
Cancel
Save