Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: boarding status in Employee Onboarding and Separation #25944

Merged
merged 5 commits into from
Jul 29, 2021

Conversation

ruchamahabal
Copy link
Member

Steps to replicate:

  1. Create an Employee Onboarding.
  2. Submit it. A project gets created automatically.
  3. Change the status for Employee Onboarding manually to "Completed". Save.
  4. Open the doc again. Status changes to Pending.

This is because Employee Onboarding fetches the status from the linked Project on load and overrides manually set status. The document is set as dirty so even though you did not make any changes on opening it you have to save it with the updated status.

The same thing happens with the Employee Separation doctype too.

employee-onboarding-before.mp4

Fix:

  1. Since boarding status is dependent on a project for both the doctypes, made it read-only.
  2. Since it is dependent on the project, it should not be updated on load but as soon as the project gets updated. Added a function update_employee_boarding_status to update boarding status on updating the project.
  3. Update tests to check if boarding status is getting updated properly on project update.
employee-onboarding-after.mp4

- make boarding status read-only as its dependent on project

- update boarding status in onboarding/separation on project update

- update tests to check status changes
@ruchamahabal ruchamahabal force-pushed the fix-employee-onboarding-status branch from c8979a5 to 67519d6 Compare June 3, 2021 12:37
@@ -114,16 +114,23 @@ def get_onboarding_details(parent, parenttype):
filters={"parent": parent, "parenttype": parenttype},
order_by= "idx")

@frappe.whitelist()
def get_boarding_status(project):
def update_employee_boarding_status(project):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why employee onboarding related functions and common class in hr/utils? Creating a separate file or putting in employee_onboarding.py will make more sense.

@nabinhait nabinhait added the CI-failing Unit tests or patch tests are failing. label Jun 24, 2021
@ruchamahabal ruchamahabal force-pushed the fix-employee-onboarding-status branch from e0203ce to 357657f Compare June 24, 2021 07:31
@coveralls
Copy link

coveralls commented Jun 24, 2021

Coverage Status

Coverage decreased (-0.02%) to 42.908% when pulling 99de84e on ruchamahabal:fix-employee-onboarding-status into 8790248 on frappe:develop.

@ruchamahabal ruchamahabal removed the CI-failing Unit tests or patch tests are failing. label Jun 24, 2021
@nabinhait nabinhait merged commit ebbabf1 into frappe:develop Jul 29, 2021
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
…ding-status

fix: boarding status in Employee Onboarding and Separation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants