Show readable fields with a default in create form

Fixes #2006 
This is a backwards compatibility fix.
This commit is contained in:
Leonel Câmara
2018-10-03 12:53:58 +01:00
committed by GitHub
parent 8276b30c32
commit 4c87932f06
+1 -1
View File
@@ -1351,7 +1351,7 @@ class SQLFORM(FORM):
if not readonly:
if not record:
# create form should only show writable fields
fields = [f.name for f in table if (ignore_rw or f.writable) and not f.compute]
fields = [f.name for f in table if (ignore_rw or f.writable or (f.readable and f.default)) and not f.compute]
else:
# update form should also show readable fields and computed fields (but in reaodnly mode)
fields = [f.name for f in table if (ignore_rw or f.writable or f.readable)]