-
-
Notifications
You must be signed in to change notification settings - Fork 785
[17.0][OU-FIX] hr: set private address data from private partners #5014
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
Conversation
legalsylvain
left a comment
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.
Makes sense !
pedrobaeza
left a comment
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.
The UPDATE is needed, as we don't want to leak private information, now that there's no record rule protection on private addresses. You can restrict the update to type="private", but not to remove it.
|
please read the link to what the base migration does and reconsider |
|
OK, we can remove it then, but with that code, you may have "NOT NULL" constraints over that fields if they have been added by third-party modules, so it's better to add "***" as I did, don't you think? |
|
the hr.employee#private_* fields are new in v17, so any constraints added by other modules won't be in effect yet. And whatever constraints exist on partner fields, will have been satisfied or violated before, so not really an issue here.
|
don't overwrite linked partner data
8bc8638 to
e61c409
Compare
|
No, I mean that you have for example a not null constraint on res.partner~state_id, or country_id. |
|
then all partners have this field set (or not and then the constraint is not effect) - I don't see the relevance of this for either this PR or the code from base? |
|
I mean the |
|
ah, I was confused because that's your own code and you talked about street before. well that could be a problem, but still not relevant for this PR, right? |
pedrobaeza
left a comment
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.
Yes, but it's just to take that into account. It's true that I mention street because I didn't see that field was correctly masked.
I don't think the hr migration should touch partner data at all: If a partner was marked as private in v16, its data is masked in the migration of the base module. If it's not private, it hasn't been protected before and we shouldn't overwrite it (think address_id == address_home_id == user_id.partner_id).
Also for handling private partners, we need to take the data from ou_res_partner_private if it exists, as otherwise we copy garbage into the employee fields.