Commit 5bb7b5b6 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_payroll: simplify Person_getPayrollEnrollmentRecord

parent fb36abd6
......@@ -16,9 +16,9 @@ if isinstance(organisation, str):
organisation = getObjectOrRaise(organisation_module, organisation)
# If no id, let's expect that the parameters are objects
career_step_list = context.objectValues(portal_type="Career",
subordination_uid=organisation.getUid(),
validation_state='open')
career_step_list = context.objectValues(portal_type="Career")
career_step_list = [career for career in career_step_list if career.getValidationState() == 'open']
if len(career_step_list) <= 0:
raise ValueError("No open Career for employee %s" % context.getRelativeUrl())
else:
......
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