[18.0][MIG] base_name_search_multi_lang: Migration to 18.0 - #3697
Open
ROBBYHOOD9 wants to merge 14 commits into
Open
[18.0][MIG] base_name_search_multi_lang: Migration to 18.0#3697ROBBYHOOD9 wants to merge 14 commits into
ROBBYHOOD9 wants to merge 14 commits into
Conversation
Currently translated at 100.0% (7 of 7 strings) Translation: server-tools-14.0/server-tools-14.0-base_name_search_multi_lang Translate-URL: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_name_search_multi_lang/es_AR/
Currently translated at 14.2% (1 of 7 strings) Translation: server-tools-14.0/server-tools-14.0-base_name_search_multi_lang Translate-URL: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_name_search_multi_lang/it/
hbrunn
requested changes
Aug 7, 2026
|
|
||
|
|
||
| @tools.ormcache("model") | ||
| def _get_model_name_search_multi_lang(self, model): |
Member
There was a problem hiding this comment.
any reason not to move this into the base model too?
Comment on lines
+14
to
+15
| Please also note that, this search feature is available only on Many2one | ||
| field. |
Member
There was a problem hiding this comment.
Suggested change
| Please also note that, this search feature is available only on Many2one | |
| field. | |
| Please also note that this search feature is available only on Many2one | |
| fields. |
Comment on lines
+11
to
+12
| "Search Translated Name". Search by Thai name, "เก้าอี้", now find the | ||
| product "Chair". |
Member
There was a problem hiding this comment.
Suggested change
| "Search Translated Name". Search by Thai name, "เก้าอี้", now find the | |
| product "Chair". | |
| "Search Translated Name". Searching by Thai name, "เก้าอี้", now finds the | |
| product "Chair". |
| @@ -0,0 +1,15 @@ | |||
| This module extends the name search feature to use other translated | |||
| language. | |||
Member
There was a problem hiding this comment.
Suggested change
| language. | |
| languages. |
|
|
||
| For example, if a product name in English is "Chair", and Thai is "เก้าอี้" | ||
|
|
||
| Given user language preference is English, when user type name to search |
Member
There was a problem hiding this comment.
Suggested change
| Given user language preference is English, when user type name to search | |
| Given user language preference is English, when user types name to search |
| @@ -0,0 +1,3 @@ | |||
| Just type into any field with translated term, such as Product on a Sale | |||
Member
There was a problem hiding this comment.
Suggested change
| Just type into any field with translated term, such as Product on a Sale | |
| Just type into any field with translated names, such as Product on a Sales |
| return bool(data and data[0]["name_search_multi_lang"]) | ||
|
|
||
|
|
||
| class Base(models.AbstractModel): |
Member
There was a problem hiding this comment.
please move this into its own file
| ids.update(model_lang._search(lang_domain)) | ||
| if not ids: | ||
| return domain | ||
| return expression.OR([domain, [("id", "in", list(ids))]]) |
Member
There was a problem hiding this comment.
does this work correctly with negative term operators? but then it's unclear to me what we want as result here, as obviously no Thai name will match an English name and vice versa. Possibly exit early if operator is in expression.NEGATIVE_TERM_OPERATORS?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration
base_name_search_multi_langfrom 14.0 to 18.01. Module Version
Updated the module version to align with Odoo 18.
2. Python Code Updates
name_searchpatching mechanism with_search_display_name().3. View Migration
4. Test Updates
BaseCommonand Odoo 18 testing conventions.5. Project Maintenance