Merge branch 'hotfix/print_bug' into dev
authorBenoit C. Sirois <benoit.clennett-sirois@auf.org>
Tue, 16 Apr 2013 20:40:37 +0000 (16:40 -0400)
committerBenoit C. Sirois <benoit.clennett-sirois@auf.org>
Tue, 16 Apr 2013 20:40:37 +0000 (16:40 -0400)
1  2 
project/dae/forms.py

diff --combined project/dae/forms.py
@@@ -366,9 -366,8 +366,8 @@@ class GroupedInlineFormset(BaseInlineFo
          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 +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)
  
@@@ -585,11 -582,7 +582,11 @@@ DossierCompReadOnlyRemunFormSet = remun
      parent_model=dae.DossierComparaison,
      model=dae.DossierComparaisonRemuneration,
      )
 -
 +RHReadOnlyRemunFormSet = remun_formset_factory_factory(
 +    read_only=True,
 +    parent_model=rh.Dossier,
 +    model=rh.Remuneration,
 +    )
  
  class PosteForm(filtered_archived_fields_form_factory(
          'classement_min',