From 4c87932f069a5e60de04cf24a653cc6f52290ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Wed, 3 Oct 2018 12:53:58 +0100 Subject: [PATCH] Show readable fields with a default in create form Fixes #2006 This is a backwards compatibility fix. --- gluon/sqlhtml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index c928e5af..ac45c040 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -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)]