[18.0] base_name_search_improved: smart search doesn't work on archived records
Module
Describe the bug
Smart search option in search view does not work for archived records
To Reproduce
Bug encountered in 18.0 Bug not present in 15.0 Other versions not tested
Steps to reproduce the behavior:
- Add smart search to product.template model, add Default code as smart search field for example
- In product list, search a products default code using smart search
- Product is returned
- Archive product
- Activate filter 'Archived' and do the same search
- Product is not returned
Expected behavior I except the smart search to work regardless of archived or not.
Let me fix it
Taking a look, it doesn't seem to be an issue of the module.
https://github.com/OCA/server-tools/blob/9932351695720ea46c8da671f142b707c634b755/base_name_search_improved/models/ir_model.py#L162
This records include both, archived and not archived.
Taking a look, it doesn't seem to be an issue of the module.
server-tools/base_name_search_improved/models/ir_model.py
Line 162 in 9932351
return [(record.id, record.display_name) for record in records] This records include both, archived and not archived.
Have you tested this in an environment? Because Odoo search does not include archived records unless explicitly added in the domain, which I do not see here
@Bart-dh Here it is solved https://github.com/OCA/server-tools/pull/3357, do you want to try it?