Skip to content

[18.0][ADD] hr_work_entry_contract_attendance_oca#1541

Open
huguesdk wants to merge 1 commit intoOCA:18.0from
coopiteasy:18.0-add-hr_work_entry_contract_attendance_oca
Open

[18.0][ADD] hr_work_entry_contract_attendance_oca#1541
huguesdk wants to merge 1 commit intoOCA:18.0from
coopiteasy:18.0-add-hr_work_entry_contract_attendance_oca

Conversation

@huguesdk
Copy link
Copy Markdown
Member

add new module hr_work_entry_contract_attendance_oca that allows to generate work entries from attendances.

add new module hr_work_entry_contract_attendance_oca.
Copy link
Copy Markdown

@mihien mihien left a comment

Choose a reason for hiding this comment

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

Lgtm, only got one question/remark but nothing blocking approval.

)
return result

def _get_interval_work_entry_type(self, interval):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Suggested change
def _get_interval_work_entry_type(self, interval):
def _get_interval_work_entry_type(self, interval: WorkIntervals):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

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.

@huguesdk
Copy link
Copy Markdown
Member Author

huguesdk commented Mar 2, 2026

@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.

@alexey-pelykh
Copy link
Copy Markdown
Contributor

@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!

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.

3 participants