On the Partner form, the State field has a domain
that is enforced if your partner has their Country selected. This means that if you choose "United States" as the Country, then it will only show States that also have a Country of "United States"
However, even when the Country is not selected, it will still restrict the number of States shown in the Search more... popup.
I'm not sure why, but if you:
- Click the Search... bar in that popup window
- Press Enter (to re-search the list)
Then it will return all available States...
It seems that this is a known issue with no plan to fix (at least not to backport to stable versions once it is fixed). See these Github Issues reports (below). This still exists on Odoo 11, even on demo.odoo.com
- Search more unpredictable
- [V8] only 80 of 160 taxes are shown: reality 2651
There are ways to work around this issue, but it requires modifying the JavaScript (as you mentioned it in your question, you may have some idea about this already). You can see this question on the Odoo forum, which has a couple of snippets.
Basically, the solution requires overriding the name_search
function out of addons/web/static/src/js/framwork/data.js
name_search: function (name, domain, operator, limit) {
# This is the magic
limit = 0;
# Just the above line
return this._model.call('name_search', {
name: name || '',
args: domain || false,
operator: operator || 'ilike',
context: this._model.context(),
limit: limit || 0
});
},
Note: This will globally affect all of your Odoo. If you want to restrict it to only one form (or some other criteria), then you must do so with whatever view/template you use to define your JavaScript import.
Previous Answer
The normal way to modify that is to change the default limit
of a Window Action in XML or the GUI and it will show more or less records by default.
- Enable Developer Mode
- Navigate to the Tree View that you want to remove limit from
- Click the “Debug” button (bug icon in top right of Odoo, next to user name)
- Click “Edit Action”
- Change the “Limit” value and save
- Limit of 0 or -1 should achieve an unlimited list, but you may need to test a couple of different values to see which works best.
- If those don’t work well, then you can change Limit to 999999 or something higher than will ever conceivably be reached.
Notes:
You can also define that limit
change via XML on the Action.
<field name=“limit”>0</field>
You can also set the limit
attribute on a tree
element directly.
Again, you may have to test this to see which value provides the unlimited list, but you can use it like this (in the tree view XML definition):
<tree id=“...” string=“...” limit=“0”/>