diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/Organisation_getEmployeeList.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/Organisation_getEmployeeList.xml index e20482a5509be31df249626e24d76c6677f90f96..3413e4b4f62923bdce19ec93ceef9477a08192d7 100644 --- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/Organisation_getEmployeeList.xml +++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/Organisation_getEmployeeList.xml @@ -84,14 +84,27 @@ if start_date == None and stop_date == None:\n start_date = DateTime(current_year, 1, 1)\n stop_date = DateTime(current_year + 1, 1, 1) - 1\n \n -employees = []\n +# Get persons\n +person_list = []\n +for subordinate in subordinate_list:\n + sub_obj = subordinate \n + sub_type = subordinate.getPortalType()\n + # The parent of Assignments and Careers objects are Persons\n + if sub_type in (\'Assignment\', \'Career\'):\n + sub_obj = subordinate.getParent()\n + sub_type = sub_obj.getPortalType()\n + # Last check to be sure we only include persons in person_list\n + if sub_type == \'Person\':\n + person_list.append(sub_obj)\n \n -for person in subordinate_list:\n - if person.getPortalType() == \'Person\' and \\\n - person.getValidationState() == \'validated\' and \\\n - person.getDefaultCareerStopDate() >= stop_date and \\\n - person.getDefaultCareerStartDate() <= start_date and \\\n - person.getRole().endswith(\'internal\') and \\\n +# Filter person list to only get employees\n +employees = []\n +for person in person_list:\n + if person.getValidationState() == \'validated\' and \\\n + person.getDefaultCareerStopDate() >= stop_date and \\\n + person.getDefaultCareerStartDate() <= start_date and \\\n + person.getRole().endswith(\'internal\') and \\\n + person.getDefaultCareerGrade() not in (None, \'\') and \\\n not person.getDefaultCareerGrade().endswith(\'trainee\'):\n # TODO: take car of discontinued career step period\n if person not in employees:\n @@ -149,8 +162,12 @@ return employees\n <string>None</string> <string>DateTime</string> <string>current_year</string> - <string>employees</string> + <string>person_list</string> <string>_getiter_</string> + <string>subordinate</string> + <string>sub_obj</string> + <string>sub_type</string> + <string>employees</string> <string>person</string> </tuple> </value> diff --git a/bt5/erp5_payroll/bt/change_log b/bt5/erp5_payroll/bt/change_log index a491383b890b1be9689fda1c75f45b27ae9f98da..6315d9410192d076d5e3e6329652ce5322346014 100644 --- a/bt5/erp5_payroll/bt/change_log +++ b/bt5/erp5_payroll/bt/change_log @@ -1,3 +1,6 @@ +2006-07-06 Kevin +* Fix Organisation_getEmployeeList to handle non-defined grade on employees. + 2006-06-29 jerome * fix matrix box in PaySheetLine_viewQuantity