-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0] hr_holidays_public: Deprecate use of employee_id in favour of partner_id #110
[16.0] hr_holidays_public: Deprecate use of employee_id in favour of partner_id #110
Conversation
# TODO: Drop function in next migration | ||
employee = False | ||
partner = False | ||
if employee_id is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if you call this method with (False, False)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From where it's called, it's supposed to have a value or be None, so no need to handle such a case
586110e
to
8e940f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain the rationale behind this change?
We need this for planning the shipments to the customers. Some (country) state have specific bank holidays and we need to plan transport accordingly |
Hello @pedrobaeza little ping to know if it can be merge :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After analyzing this, it's a bit weird to have something prefixed with hr
, but using a partner, but it's OK if you don't deprecate ever the employee_id
argument. It may be needed because in any override, you may have some information on the employee that vary the result. Losing the argument, you won't be able to access to this info.
Helper functions to find public holidays did allow to use an hr.employee to filter country and states based on the employee address. Since only the address of the employee was used, modifying the functions to use a res.partner instead of an hr.employee allows more possibilities such as checking public holidays for customers and suppliers.
8e940f5
to
42ceea6
Compare
@pedrobaeza I kept the possiblity to use IMO for future versions public holidays should be taken out of the hr module as it's not necessarily linked only to hr. We could have a calendar_holidays_public module and then we could bridge the gap to the hr keeping hr_holidays_public. |
@pedrobaeza Can you please update your review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's go with the split in future version.
/ocabot merge major
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at cef403f. Thanks a lot for contributing to OCA. ❤️ |
Helper functions to find public holidays did allow to use an hr.employee to filter country and states based on the employee address.
Since only the address of the employee was used, modifying the functions to use a res.partner instead of an hr.employee allows more possibilities such as checking public holidays for customers and suppliers.