Skip to content

Commit bdeac98

Browse files
committed
[MIG] base_name_search_improved: Migration to 19.0
1 parent 1ee1e00 commit bdeac98

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

base_name_search_improved/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Improved Name Search
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
24-
:target: https://github.com/OCA/server-tools/tree/18.0/base_name_search_improved
24+
:target: https://github.com/OCA/server-tools/tree/19.0/base_name_search_improved
2525
:alt: OCA/server-tools
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_name_search_improved
27+
:target: https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-base_name_search_improved
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -119,7 +119,7 @@ Bug Tracker
119119
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
120120
In case of trouble, please check there if your issue has already been reported.
121121
If you spotted it first, help us to smash it by providing a detailed and welcomed
122-
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_name_search_improved%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
122+
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_name_search_improved%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
123123

124124
Do not contact contributors directly about support or help with technical issues.
125125

@@ -159,6 +159,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
159159
mission is to support the collaborative development of Odoo features and
160160
promote its widespread use.
161161

162-
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/base_name_search_improved>`_ project on GitHub.
162+
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/19.0/base_name_search_improved>`_ project on GitHub.
163163

164164
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

base_name_search_improved/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Improved Name Search",
55
"summary": "Friendlier search when typing in relation fields",
6-
"version": "18.0.1.1.0",
6+
"version": "19.0.1.0.0",
77
"category": "Uncategorized",
88
"website": "https://github.com/OCA/server-tools",
99
"author": "Daniel Reis, Odoo Community Association (OCA), ADHOC SA",

base_name_search_improved/models/ir_model.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
from odoo import api, fields, models, tools
1010
from odoo.exceptions import ValidationError
11-
from odoo.osv import expression
11+
from odoo.fields import Domain
1212

1313
_logger = logging.getLogger(__name__)
1414
# Extended name search is only used on some operators
1515
ALLOWED_OPS = {"ilike", "like"}
1616

1717

18-
@tools.ormcache(skiparg=0)
18+
@tools.ormcache()
1919
def _get_rec_names(self):
2020
"List of fields to search into"
2121
model = self.env["ir.model"].search([("model", "=", str(self._name))])
@@ -24,7 +24,7 @@ def _get_rec_names(self):
2424
return rec_name + other_names
2525

2626

27-
@tools.ormcache(skiparg=0)
27+
@tools.ormcache()
2828
def _get_use_smart_name_search(self):
2929
return (
3030
self.env["ir.model"]
@@ -33,7 +33,7 @@ def _get_use_smart_name_search(self):
3333
)
3434

3535

36-
@tools.ormcache(skiparg=0)
36+
@tools.ormcache()
3737
def _get_add_smart_search(self):
3838
"Add Smart Search on search views"
3939
model = self.env["ir.model"].search([("model", "=", str(self._name))])
@@ -43,7 +43,7 @@ def _get_add_smart_search(self):
4343
return False
4444

4545

46-
@tools.ormcache(skiparg=0)
46+
@tools.ormcache()
4747
def _get_name_search_domain(self):
4848
"Add Smart Search on search views"
4949
name_search_domain = (
@@ -110,12 +110,12 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
110110

111111
# Try regular search on each additional search field
112112
for rec_name in all_names:
113-
domain = expression.AND([base_domain, [(rec_name, operator, name)]])
113+
domain = Domain.AND([base_domain, [(rec_name, operator, name)]])
114114
results = _extend_name_results(self, domain, results, limit)
115115

116116
# Try ordered word search on each of the search fields
117117
for rec_name in all_names:
118-
domain = expression.AND(
118+
domain = Domain.AND(
119119
[base_domain, [(rec_name, operator, name.replace(" ", "%"))]]
120120
)
121121
results = _extend_name_results(self, domain, results, limit)
@@ -126,16 +126,16 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
126126
if " " in name:
127127
unordered_domain = []
128128
for word in name.split():
129-
word_domain = expression.OR(
129+
word_domain = Domain.OR(
130130
[[(rec_name, operator, word)] for rec_name in all_names]
131131
)
132132
unordered_domain = (
133-
expression.AND([unordered_domain, word_domain])
133+
Domain.AND([unordered_domain, word_domain])
134134
if unordered_domain
135135
else word_domain
136136
)
137137
results = _extend_name_results(
138-
self, expression.AND([base_domain, unordered_domain]), results, limit
138+
self, Domain.AND([base_domain, unordered_domain]), results, limit
139139
)
140140

141141
results = results[:limit]
@@ -211,7 +211,7 @@ def check_name_search_domain(self):
211211
RecursionError,
212212
) as e:
213213
raise ValidationError(
214-
self.env._("Couldn't eval Name Search Domain (%s)") % e
214+
self.env._("Couldn't eval Name Search Domain (%s)", e)
215215
) from e
216216
if not isinstance(name_search_domain, list):
217217
raise ValidationError(

base_name_search_improved/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Improved Name Search</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:506ec7a25a0bb1d86a79c06d4577aca5a3cda5d81ed921490e95a53a5e49df24
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/base_name_search_improved"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_name_search_improved"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/19.0/base_name_search_improved"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-base_name_search_improved"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>Extends the name search feature to use additional, more relaxed matching
379379
methods, and to allow searching into configurable additional record
380380
fields.</p>
@@ -455,7 +455,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
455455
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
456456
In case of trouble, please check there if your issue has already been reported.
457457
If you spotted it first, help us to smash it by providing a detailed and welcomed
458-
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_name_search_improved%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
458+
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_name_search_improved%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
459459
<p>Do not contact contributors directly about support or help with technical issues.</p>
460460
</div>
461461
<div class="section" id="credits">
@@ -491,7 +491,7 @@ <h3><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h3>
491491
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
492492
mission is to support the collaborative development of Odoo features and
493493
promote its widespread use.</p>
494-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/18.0/base_name_search_improved">OCA/server-tools</a> project on GitHub.</p>
494+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/19.0/base_name_search_improved">OCA/server-tools</a> project on GitHub.</p>
495495
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
496496
</div>
497497
</div>

base_name_search_improved/tests/test_name_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_SmartSearchWarning(self):
105105
"ttype": "char",
106106
"model_id": self.model_partner.id,
107107
"model": self.model_partner.model,
108-
"translate": True,
108+
"translate": "standard",
109109
}
110110
)
111111
self.model_partner.name_search_ids = [(4, translatable_field.id)]

0 commit comments

Comments
 (0)