Odoo 9 - Massive lag on large one2many records
As the title says, my issue is that a specific use case for one2many fields that we have developed in our custom modules is to create a table on a form. These tables will contain anywhere between 0 to in some rare cases 5000 items, mostly a few hundred.
Something that we've noticed and is especially of frustration to the people who have to interact with these forms; the lag. What happens is after around 600 items or so, every interaction with the table will cause Odoo to show the "Loading" fab at the top and a long delay spinner, 3-5 seconds.
I expect that part of the issue is that it seems the entire record is stored in the web client's state (In the browser). We do have one or two onchange functions that are within the model itself.
What are my options in reducing this lag as much as possible? Simply removing/consolidating/making my methods as efficient as possible? What if I get to the point where I don't need to compute onchange values?