Fix
[auf_rh_dae.git] / project / dae / forms.py
index 9352637..b0cd578 100644 (file)
@@ -366,9 +366,8 @@ class GroupedInlineFormset(BaseInlineFormSet):
         if self.is_bound:
             return self.management_form.cleaned_data[TOTAL_FORM_COUNT]
         else:
-            return len(self.forms)
-        print total_forms
-        return total_forms
+            i_count = self.initial_form_count()
+            return i_count + self.extra * len(self._groups)
 
     def set_groups(self,
                    groups,
@@ -475,10 +474,8 @@ def remun_formset_factory(parent_model,
                 rtype.nature_remuneration
                 )
 
-
-
-    # Monkey patch FormSet.
     def __init__(inst, *a, **kw):
+        inst._groups = groups
         super(inst.__class__, inst).__init__(*a, **kw)
         inst.set_groups(groups, grouper, choice_overrides)