add form parameter to control display of inlined relation form stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 23 Jun 2009 13:34:28 +0200
branchstable
changeset 2143 d4c2fb633062
parent 2142 098aa2075903
child 2144 51c84d585456
child 2147 476a75ede2cc
add form parameter to control display of inlined relation form
web/views/autoform.py
--- a/web/views/autoform.py	Tue Jun 23 13:33:57 2009 +0200
+++ b/web/views/autoform.py	Tue Jun 23 13:34:28 2009 +0200
@@ -292,7 +292,7 @@
 
         by default true if there is no related entity and we need at least one
         """
-        return not existant and card in '1+'
+        return not existant and card in '1+' or self.req.form.has_key('force_%s_display' % rschema)
 
     def should_display_add_new_relation_link(self, rschema, existant, card):
         """return true if we should add a link to add a new creation form