Skip to Content
Menu
This question has been flagged
1 Reply
3202 Views

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?

Avatar
Discard
Best Answer

Hi David,

In general the performance of big onemany fields has been a bit of a problem throughout history in Odoo. Odoo 11 and 12 have improved this as they use less calls (and better caching) between the frontend and backend causing lower loading times. The issue is still there though, it just got smaller. It is always a bit of a challenge to figure this out but as a general rule of thumbs you should try to minimalise the amount of computed fields and onchanges on models. The less you have of these the faster your loading will be.

Since Odoo V11 there is a great way to figure out performance issues by attaching a profiler to your functions. With this profiler you can see for every line of the function how long it takes so you'll know easily in which lines your performance problems are caused. See https://www.odoo.com/documentation/11.0/howtos/profilecode.html for more information. Sadly this is not available for V9/V10 but you could make a backport of the function in your Odoo in order to be able to measure it at your end.

I know this is not an ideal answer but atleast it gives you some pointers and ideas. You might also consider an upgrade to be able to combat part of the performance problems and having access to more tools. Even if you have no more computes and onchanges it will still need some time to load though, don't expect it to get under a second.

Regards,
Yenthe



Avatar
Discard
Related Posts Replies Views Activity
0
Sep 23
496
0
Sep 23
450
2
Feb 23
9251
6
Oct 23
19265
3
Mar 24
7684