Skip to content
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

[FW][FIX] base: search user by name negatively #44146

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 28, 2020

When we name_search a res.user, we have a special hack so we will
firstly perform an exact search on the res.users login, if none is found
we will search over res.users name.

This is intended but in the case of negative search since 660cebb,
for example operator='not ilike' and name='test' would probably just
return all user that do not have a login that is exactly test.

This is not the intended behavior, in this instance we should just
return user that do not have "test" in their names.

Without fix, added test would fail on:

  • .name_search('vlad', operator='not ilike') => finding everyone but
    user with exactly login vlad instead of user not containing vlad in
    their name

  • .name_search('', operator='not ilike') => find all users instead of
    finding no user

opw-2170517

Forward-Port-Of: #44040

When we name_search a res.user, we have a special hack so we will
firstly perform an exact search on the res.users login, if none is found
we will search over res.users name.

This is intended but in the case of negative search since 660cebb,
for example operator='not ilike' and name='test' would probably just
return all user that do not have a login that is exactly test.

This is not the intended behavior, in this instance we should just
return user that do not have "test" in their names.

Without fix, added test would fail on:

- .name_search('vlad', operator='not ilike') => finding everyone but
  user with exactly login vlad instead of user not containing vlad in
  their name

- .name_search('', operator='not ilike') => find all users instead of
  finding no user

- .name_search('lad', operator='not ilike') => find all users instead of
  just finding "Nothing similar"

opw-2170517
closes odoo#44040

X-original-commit: 2378fb6
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 28, 2020

This PR targets saas-12.3 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jan 28, 2020
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Jan 28, 2020
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Jan 28, 2020
robodoo pushed a commit that referenced this pull request Jan 29, 2020
When we name_search a res.user, we have a special hack so we will
firstly perform an exact search on the res.users login, if none is found
we will search over res.users name.

This is intended but in the case of negative search since 660cebb,
for example operator='not ilike' and name='test' would probably just
return all user that do not have a login that is exactly test.

This is not the intended behavior, in this instance we should just
return user that do not have "test" in their names.

Without fix, added test would fail on:

- .name_search('vlad', operator='not ilike') => finding everyone but
  user with exactly login vlad instead of user not containing vlad in
  their name

- .name_search('', operator='not ilike') => find all users instead of
  finding no user

- .name_search('lad', operator='not ilike') => find all users instead of
  just finding "Nothing similar"

opw-2170517
closes #44040

closes #44146

X-original-commit: 2378fb6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
@robodoo robodoo closed this Jan 29, 2020
@robodoo robodoo temporarily deployed to merge January 29, 2020 11:02 Inactive
@fw-bot fw-bot deleted the saas-12.3-12.0-base-opw-2170517-nle-uzY6-fw branch February 12, 2020 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants