Esempio n. 1
0
    def _createFinancesGroup(self):
        """
           Create the finances group.
        """
        context = self.portal.portal_setup._getImportContext('Products.MeetingCharleroi:testing')
        initializer = ToolInitializer(context, PROJECTNAME)
        # create echevin2 first as it is a group in charge of finances org
        orgs, active_orgs, savedOrgsData = initializer.addOrgs([charleroi_import_data.ech2_grp])
        for org in orgs:
            org_uid = org.UID()
            self._select_organization(org_uid)

        dirfin_grp = deepcopy(charleroi_import_data.dirfin_grp)
        dirfin_grp.groups_in_charge = [org_id_to_uid(group_in_charge_id)
                                       for group_in_charge_id in dirfin_grp.groups_in_charge]

        orgs, active_orgs, savedOrgsData = initializer.addOrgs([dirfin_grp])
        initializer.data = initializer.getProfileData()
        for org in orgs:
            org_uid = org.UID()
            org.item_advice_states = initializer._correct_advice_states(dirfin_grp.item_advice_states)
            org.item_advice_edit_states = initializer._correct_advice_states(dirfin_grp.item_advice_edit_states)
            self._select_organization(org_uid)
            select_org_for_function(org_uid, 'financialcontrollers')
            select_org_for_function(org_uid, 'financialeditors')
            select_org_for_function(org_uid, 'financialmanagers')
            select_org_for_function(org_uid, 'financialreviewers')
        # clean forever cache on utils finance_group_uid
        _memos.clear()
Esempio n. 2
0
    def _createFinancesGroup(self):
        """
           Create the finances group.
        """
        context = self.portal.portal_setup._getImportContext('Products.MeetingPROVHainaut:testing')
        initializer = ToolInitializer(context, PROJECTNAME)

        dirfin_grp = deepcopy(provhainaut_import_data.dirfincec)
        orgs, active_orgs, savedOrgsData = initializer.addOrgs([dirfin_grp])
        initializer.data = initializer.getProfileData()
        for org in orgs:
            org_uid = org.UID()
            self._select_organization(org_uid)
            select_org_for_function(org_uid, 'financialprecontrollers')
            select_org_for_function(org_uid, 'financialcontrollers')
            select_org_for_function(org_uid, 'financialeditors')
            select_org_for_function(org_uid, 'financialmanagers')
            select_org_for_function(org_uid, 'financialreviewers')
        # clean forever cache on utils finance_group_uid
        _memos.clear()