[18.0][ADD] hr_work_entry_contract_attendance_oca#1541
[18.0][ADD] hr_work_entry_contract_attendance_oca#1541
Conversation
add new module hr_work_entry_contract_attendance_oca.
mihien
left a comment
There was a problem hiding this comment.
Lgtm, only got one question/remark but nothing blocking approval.
| ) | ||
| return result | ||
|
|
||
| def _get_interval_work_entry_type(self, interval): |
There was a problem hiding this comment.
Can typing be used in those kind of case? I haven't ever seen typing being used in odoo modules, but in my opinion it would benefit from it, clarity-wise.
| def _get_interval_work_entry_type(self, interval): | |
| def _get_interval_work_entry_type(self, interval: WorkIntervals): |
There was a problem hiding this comment.
yes, indeed, typing could be used. this is far from being the norm in odoo development (i didn’t encounter yet any type hints in the odoo codebase itself), but i’ve already seen some in oca(-like) modules, like here. there is nothing about it in oca’s guidelines, though.
alexey-pelykh
left a comment
There was a problem hiding this comment.
Thanks for this -- generating work entries from attendances fills a real gap. The _get_attendance_intervals override with lunch break subtraction logic is well thought out, and the WorkIntervals usage is correct.
The test file only contains TODO comments with no actual test methods though. At minimum, a test verifying that work entries get generated from an attendance with check_in/check_out would be needed. The attendance domain logic and lunch break handling are the critical paths to cover.
Happy to re-review once there's at least basic test coverage.
|
@alexey-pelykh hey, thanks for the review! i agree, there are still some important parts missing (as explained in the roadmap), but it is already partly usable now, using the “regenerate work entries” wizard. do you think i should convert the pr to draft? moreover, if you need these missing functions, feel free to take over in another pr. |
|
@huguesdk Thanks for the context! I would say keep it as a non-draft — it is already partially usable with the regenerate wizard, and having it visible encourages others to build on it. The roadmap in the description makes the scope clear. If I get a chance to contribute the missing pieces I will open a follow-up PR. Cheers! |
add new module
hr_work_entry_contract_attendance_ocathat allows to generate work entries from attendances.