Files
odoo_source/addons/hr_work_entry_contract
alsh-odoo 74801ad8e9 [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/odoo#138033

X-original-commit: cc3898ad109e9dfdb220a7245936693197ed79b1
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-10-10 01:59:46 +00:00
..
…
…