-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
[14.0] product_template_multi_link: improve UX by searching templates on default_code #800
[14.0] product_template_multi_link: improve UX by searching templates on default_code #800
Conversation
133aafb
to
9cba4e0
Compare
# Reset 'name' so base '_name_search' won't add '_rec_name' | ||
# to 'args' (already added above). | ||
# See 'odoo.models.BaseModel._name_search'. | ||
name = "" |
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.
# NOTE: Odoo limits the search on the name of templates as soon as | ||
# the 'id' field is present in 'args' domain, and this 'id' criteria is | ||
# set by the view on purpose to avoid a search on variants. | ||
# Improve this search by looking also on template's default_code | ||
# if there is only a domain on 'id'. | ||
search_default_code = self.env.context.get("name_search_default_code") | ||
if name and len(args or []) == 1 and args[0][0] == "id" and search_default_code: |
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.
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.
Not blocking
This PR has the |
Added another use case: search on templates with default codes of variants (like Odoo std behavior) as the default code of a template is empty as soon as it gets some variants. |
), | ||
] | ||
) | ||
# Reset 'name' so base '_name_search' won't add '_rec_name' |
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.
🥇
@sebalix pre-commit is not happy. And don't forget to squash on the next push 🙏 |
81720ff
to
6d6d7ff
Compare
@simahawk done |
/ocabot merge minor |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 06f7a38. Thanks a lot for contributing to OCA. ❤️ |
No description provided.