Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] hr_work_entry_contract: compute duration without employee
This traceback arises when the user changes the 'end_date' without the employee value, while creating a new 'Work Entry'. To reproduce this issue: 1) Install 'hr_work_entry_contract' 2) Open 'payroll' and create a new 'Work Entry' 3) Select 'Work Entry Type' as 'Unpaid' and change the 'To' date Error:- 'KeyError: False' On the '_get_duration_batch' method, when the user is not given employee value, there will be no 'contract_id' as it is getting value from 'employee_id'. It leads to the above traceback as 'result[work_entry.id]' is getting value through 'employee.id'. See:- https://github.com/odoo/odoo/blob/a277faa2ffab7559fcbad95fcc1e8fd6a26d756b/addons/hr_work_entry_contract/models/hr_work_entry.py#L110-L112 Will resolve this issue by calculating duration without employee sentry-4514970596 closes odoo#138033 X-original-commit: cc3898a Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
- Loading branch information