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