Skip to content

[IMP] core: _search_display_name replaces _name_search#174967

Closed
kmagusiak wants to merge 2 commits intoodoo:masterfrom
odoo-dev:master-domain-name-search-krma
Closed

[IMP] core: _search_display_name replaces _name_search#174967
kmagusiak wants to merge 2 commits intoodoo:masterfrom
odoo-dev:master-domain-name-search-krma

Conversation

@kmagusiak
Copy link
Copy Markdown
Contributor

@kmagusiak kmagusiak commented Jul 30, 2024

Aligning the behaviour of name searches to other fields. Since the displayed name is display_name, implementing search on it gives the domain to use for searches by name.
The function _name_search has therefore no reason to exist anymore. We keep the function name_search which is public and move the logic linked to displaying a limited number of records there.

odoo/enterprise#67592
odoo/documentation#10856
task-3484032


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Jul 30, 2024

Pull request status dashboard

@kmagusiak kmagusiak force-pushed the master-domain-name-search-krma branch from 92d0ded to d7ccd85 Compare July 30, 2024 10:40
@kmagusiak kmagusiak requested review from rco-odoo and ryv-odoo July 30, 2024 10:41
@C3POdoo C3POdoo added the RD research & development, internal work label Jul 30, 2024
@kmagusiak kmagusiak marked this pull request as ready for review July 30, 2024 12:31
@C3POdoo C3POdoo requested review from a team, BastienFafchamps, davidmonnom, epictete and juliusc2066 and removed request for a team July 30, 2024 12:33
@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 4, 2024

Merge method set to rebase and fast-forward.

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 4, 2024

@kmagusiak @rco-odoo linked pull request(s) odoo/documentation#10856, odoo/enterprise#67592 not ready. Linked PRs are not staged until all of them are ready.

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 4, 2024

@kmagusiak @rco-odoo linked pull request(s) odoo/documentation#10856 not ready. Linked PRs are not staged until all of them are ready.

@kmagusiak kmagusiak force-pushed the master-domain-name-search-krma branch from b41f0ec to 0b848e4 Compare September 5, 2024 12:06
kmagusiak added a commit to odoo/documentation that referenced this pull request Sep 5, 2024
kmagusiak and others added 2 commits September 6, 2024 06:28
Aligning the behaviour of name searches to other fields. Since the
displayed name is `display_name`, implementing `search` on it gives the
domain to use for searches by name.
The function `_name_search` has therefore no reason to exist anymore. We
keep the function `name_search` which is public and move the logic
linked to displaying a limited number of records there.

task-3484032
…model

We simply introduce a special case: using "x_id.id" doesn't recurse on
the field's comodel.  It simply uses the value of the many2one id
itself.
@kmagusiak kmagusiak force-pushed the master-domain-name-search-krma branch from 0b848e4 to 8339326 Compare September 6, 2024 06:29
kmagusiak added a commit to odoo/documentation that referenced this pull request Sep 6, 2024
@rco-odoo
Copy link
Copy Markdown
Member

rco-odoo commented Sep 6, 2024

@robodoo rebase-ff r+

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 6, 2024

Merge method set to rebase and fast-forward.

robodoo pushed a commit that referenced this pull request Sep 6, 2024
Aligning the behaviour of name searches to other fields. Since the
displayed name is `display_name`, implementing `search` on it gives the
domain to use for searches by name.
The function `_name_search` has therefore no reason to exist anymore. We
keep the function `name_search` which is public and move the logic
linked to displaying a limited number of records there.

task-3484032

Part-of: #174967
Related: odoo/enterprise#67592
Related: odoo/documentation#10856
Signed-off-by: Raphael Collet <rco@odoo.com>
robodoo pushed a commit that referenced this pull request Sep 6, 2024
…model

We simply introduce a special case: using "x_id.id" doesn't recurse on
the field's comodel.  It simply uses the value of the many2one id
itself.

closes #174967

Related: odoo/enterprise#67592
Related: odoo/documentation#10856
Signed-off-by: Raphael Collet <rco@odoo.com>
robodoo pushed a commit to odoo/documentation that referenced this pull request Sep 6, 2024
odoo/odoo#174967

closes #10856

Related: odoo/enterprise#67592
Signed-off-by: Raphael Collet <rco@odoo.com>
@robodoo robodoo closed this Sep 6, 2024
@robodoo robodoo added the 17.5 label Sep 6, 2024
@kmagusiak kmagusiak deleted the master-domain-name-search-krma branch September 6, 2024 11:59
ryv-odoo pushed a commit to odoo-dev/odoo that referenced this pull request Sep 26, 2024
Since odoo#174967, use name_search on task doesn't work correctly:
"Non-stored field project.task.display_name cannot be searched"
Which makes any many2one toward it unsearchable.

The field display_name is only added when no display_name are set on the model. It means that every model 'overriding' display_name should also included `search='_search_display_name'`.

Two solution:
- add `display_name` has a normal field to be extended as usual. (import nightmare to fix)
- just add  `search='_search_display_name'` on every model taht have display_name =field...
lef-adhoc added a commit to adhoc-dev/odoo-module-migrator that referenced this pull request Oct 29, 2024
lef-adhoc added a commit to adhoc-dev/odoo-module-migrator that referenced this pull request Oct 29, 2024
LucasTran380381 pushed a commit to trobz/odoo-module-migrator that referenced this pull request Nov 22, 2024
bosd pushed a commit to bosd/odoo-module-migrator that referenced this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

18.0 RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants