diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateWorkTimeSalary.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateWorkTimeSalary.xml index a595bafe0e5456ee5bd27c297bf4215182970e94..f2e34fa5d27584e40e20ebde31ef522dcfe1d4fd 100644 --- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateWorkTimeSalary.xml +++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateWorkTimeSalary.xml @@ -76,6 +76,7 @@ search_params = \\\n \'portal_type\' : \'Pay Sheet Transaction\',\n \'delivery.start_date\' : {\'range\': "minmax", \'query\': (from_date, to_date)},\n \'delivery.source_section_uid\' : context.getSourceSectionUid(),\n + \'delivery.destination_section_uid\' : context.getDestinationSectionUid(),\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n }\n \n @@ -85,6 +86,11 @@ yearly_work_time = 0\n for paysheet in paysheet_list:\n annotation_line = paysheet.getAnnotationLineFromReference(\\\n reference=\'work_time_annotation_line\')\n + if annotation_line is None:\n + annotation_line = getattr(paysheet, \'work_time_annotation_line\', None)\n + if annotation_line is None:\n + raise ValueError, "Paysheet %s has no Annotation Line with reference work_time_annotation_line"\\\n + % paysheet.getRelativeUrl()\n nb_heures = annotation_line.getQuantity()\n yearly_work_time += nb_heures\n \n @@ -103,6 +109,12 @@ return yearly_work_time\n <none/> </value> </item> + <item> + <key> <string>_owner</string> </key> + <value> + <none/> + </value> + </item> <item> <key> <string>_params</string> </key> <value> <string></string> </value> @@ -145,6 +157,9 @@ return yearly_work_time\n <string>_getiter_</string> <string>paysheet</string> <string>annotation_line</string> + <string>None</string> + <string>getattr</string> + <string>ValueError</string> <string>nb_heures</string> <string>_inplacevar_</string> </tuple> diff --git a/bt5/erp5_payroll/bt/revision b/bt5/erp5_payroll/bt/revision index 7df2addf7bc9cd19503604ea1570ed91c6ffd0b8..f937f7e2b36014ad312ae68bba28b0ec7be25770 100644 --- a/bt5/erp5_payroll/bt/revision +++ b/bt5/erp5_payroll/bt/revision @@ -1 +1 @@ -232 \ No newline at end of file +233 \ No newline at end of file