Commit 305e8366 authored by Jérome Perrin's avatar Jérome Perrin

PaySheetTransaction_getYearToDateWorkTimeSalary: if we cannot find a line with...

PaySheetTransaction_getYearToDateWorkTimeSalary: if we cannot find a line with reference, try with ID, because this work_time_annotation_line will be created by accessor

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20201 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 01b2fde2
......@@ -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>
......
232
\ No newline at end of file
233
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment