web/views/forms.py
changeset 2049 b9baedffeb8b
parent 2048 5e4d1433b90b
child 2050 ce184fdb1e56
--- a/web/views/forms.py	Fri Jun 05 10:03:16 2009 +0200
+++ b/web/views/forms.py	Fri Jun 05 10:18:40 2009 +0200
@@ -268,9 +268,10 @@
         self.form_add_hidden('__type', eidparam=True)
         self.form_add_hidden('eid')
         if msg:
+            self.form_add_hidden('__message', msg)
+        if kwargs.get('mainform'):
+            self.form_add_hidden(u'__maineid', self.edited_entity.eid)
             # If we need to directly attach the new object to another one
-            self.form_add_hidden('__message', msg)
-        if not self.is_subform:
             for linkto in self.req.list_form_param('__linkto'):
                 self.form_add_hidden('__linkto', linkto)
                 msg = '%s %s' % (msg, self.req._('and linked'))