server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

base_name_search_improved 'Query' object has no attribute 'extend'

Open framatt opened this issue 2 years ago • 2 comments

Module

base_name_search_improved

Describe the bug

Error: Odoo Server Error

Traceback (most recent call last): File "/opt/odoo14/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/opt/odoo14/odoo/odoo/http.py", line 683, in dispatch result = self._call_function(**self.params) File "/opt/odoo14/odoo/odoo/http.py", line 359, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo14/odoo/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo14/odoo/odoo/http.py", line 347, in checked_call result = self.endpoint(*a, **kw) File "/opt/odoo14/odoo/odoo/http.py", line 912, in call return self.method(*args, **kw) File "/opt/odoo14/odoo/odoo/http.py", line 531, in response_wrap response = f(*args, **kw) File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1394, in call_kw return self._call_kw(model, method, args, kwargs) File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1386, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo14/odoo/odoo/api.py", line 395, in call_kw result = _call_kw_model(method, model, args, kwargs) File "/opt/odoo14/odoo/odoo/api.py", line 368, in _call_kw_model result = method(recs, *args, **kwargs) File "/opt/odoo14/odoo/odoo/models.py", line 1800, in name_search ids = self._name_search(name, args, operator, limit=limit) File "/opt/odoo14/odoo14-custom-addons/base_name_search_improved/models/ir_model.py", line 101, in _name_search res = _extend_name_results( File "/opt/odoo14/odoo14-custom-addons/base_name_search_improved/models/ir_model.py", line 65, in _extend_name_results results.extend(rec_ids) Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/odoo14/odoo/odoo/http.py", line 639, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo14/odoo/odoo/http.py", line 315, in _handle_exception raise exception.with_traceback(None) from new_cause AttributeError: 'Query' object has no attribute 'extend'

To Reproduce

Affected versions: V14

Steps to reproduce the behavior: Cant reproduce on other systems, but as soon as it switched to smart search the error above pops up, searching for a product in a sales order

Expected behavior Search Results must show

framatt avatar Feb 03 '23 10:02 framatt

fix
if isinstance(results, list): results.extend(rec_ids)

framatt avatar Feb 16 '23 07:02 framatt

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Nov 09 '25 12:11 github-actions[bot]