Skip to content

[19.0][IMP] hr: set contract start date to employee's create date#5605

Open
hbrunn wants to merge 1 commit intoOCA:19.0from
hbrunn:19.0-hr-set-employee-contract-date
Open

[19.0][IMP] hr: set contract start date to employee's create date#5605
hbrunn wants to merge 1 commit intoOCA:19.0from
hbrunn:19.0-hr-set-employee-contract-date

Conversation

@hbrunn
Copy link
Copy Markdown
Member

@hbrunn hbrunn commented Apr 27, 2026

this one is more an rfc: When migrating a database without hr_contract, all employees end up without a contract start date. Any code looking for active versions will treat those employees as inactive, so it might be a good idea to set some date.

On the other hand, this will most likely be a wrong date, so that's an argument for not doing it and having HR managers fill in the correct date afterwards.

@hbrunn hbrunn added this to the 19.0 milestone Apr 27, 2026
@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels Apr 27, 2026
Copy link
Copy Markdown
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

I think it's better to not have them deactivated, although the date is not correct. I suppose this date is modified having hr_contract installed, isn't it?

@hbrunn
Copy link
Copy Markdown
Member Author

hbrunn commented Apr 27, 2026

I think it's better to not have them deactivated, although the date is not correct. I suppose this date is modified having hr_contract installed, isn't it?

yes. So they aren't deactivated in the active=False sense, but whenever something date dependent happens, https://github.com/odoo/odoo/blob/19.0/addons/hr/models/hr_employee.py#L1622 is called, which excludes employees without start date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants