odoo/odoo#199498
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:master-saas-18.1-sentry-6301787988-valueerror-exp_singleton_hr_emp-kkuj-419056-fw
- head
- 3f0b5eef5b8b545f402febc0a0811ef4de4cc3ad
- merged
- 3 months ago by Kishan Kumar Jaiswal (kkuj)
odoo/odoo | |
---|---|
saas-18.1 | #198088 |
saas-18.2 | #199483 |
saas-18.3 | |
master | #199498 |
[FW][FIX] hr: prevent error while getting default departure date
Currently, an exception is raised when a user attempts to archive a new employee before saving.
Steps to Reproduce:
- Install the HR module.
- Navigate to the Employee Module.
- Try to archive a new employee before saving.
- An error occurs.
Error:
ValueError
Expected singleton: hr.employee()
This issue occurs when a user tries to archive a new employee before saving because the system expects a default departure date for the employee, which can't be set properly without saving the employee record first.
[1] -
https://github.com/odoo/odoo/blob/4f58eb9db55c102786010efe3c1fb74edefaf8f3/addons/hr/wizard/hr_departure_wizard.py#L13
This fix resolves the issue by first checking if the employee exists, and then proceeding to find the departure date.
sentry-6301787988
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: #198088