specify formvid=edition to get multiple edition working w/ 3.6
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 21 Jan 2010 10:57:20 +0100
changeset 4310 a139b98b6af5
parent 4309 bdac9e9e76cd
child 4311 e9e93967b7b5
specify formvid=edition to get multiple edition working w/ 3.6
web/views/editforms.py
--- a/web/views/editforms.py	Thu Jan 21 10:52:47 2010 +0100
+++ b/web/views/editforms.py	Thu Jan 21 10:57:20 2010 +0100
@@ -440,7 +440,14 @@
         form = self._cw.vreg['forms'].select(self.__regid__, self._cw,
                                              rset=self.cw_rset,
                                              copy_nav_params=True)
-        self.w(form.render())
+        # XXX overriding formvid (eg __form_id) necessary to make work edition:
+        # the edit controller try to select the form with no rset but
+        # entity=entity, and use this form to edit the entity. So we want
+        # edition form there but specifying formvid may have other undesired
+        # side effect. Maybe we should provide another variable optinally
+        # telling which form the edit controller should select (eg difffers
+        # between html generation / post handling form)
+        self.w(form.render(formvid='edition'))
 
 
 class InlineEntityEditionFormView(FormViewMixIn, EntityView):