[trunk] Adding products in quotes is too slow

Bug #1075633 reported by Cats&Dogs
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 2

Bug Description

Hello,

Testing the Quote system in OpenERP 7.0
When you have a product database of some volume (our demo has 60.000 products), and you want to add product lines by using the search more function it can take more than 2 minutes before you get your search screen. This also affects other search more options on other screens than Quotes.

It seems that while opening the search popup all product data is being loaded in advance. Questions is why? When we alter the code for it (see below) it is working fast and still correct. Not sure why all 60.000 products should be loaded in advance.

Altered code (suggestion):

file: product.py
function: def search(self, cr, uid, args, offset = 0, limit = None, order = None, context = None, count = False)

added rule(737)

=> if not limit and not limit is None:
      limit = 80

This way only 80 products are being loaded in advance, search in complete database is still working.

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Wishlist
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Revision history for this message
Numérigraphe (numerigraphe) wrote :

I suggest you make a merge proposal.
Lionel Sausin.

summary: - [trunk] Adding products in quotes is to slow
+ [trunk] Adding products in quotes is too slow
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Note that the suggested change breaks the API very hard, as we really expect to receive all resources when we call this method with limit=0. And since the official client library does not support named arguments, the obvious workaround of leaving out the argument does not work when you want to pass the context for instance.

However, If what Geert says is the case and all records are preloaded in a many2one search widget, then would it perhaps make more sense to set the default limit for this widget to 100 (same as the limit of name_search) in the client instead of hardcoding this just for the product model?

Revision history for this message
Cats&Dogs (catsanddogs) wrote :

Hello Stefan,

I agree, it might be not the best way to fix this.
The only thing I have noticed is that all forms which use the product search field, and so the search more links, work at an acceptable speed after I've changed this in the core. And I didn't noticed a problem with missing products in my search results.

Only problem which I've detected, the POS is only loading 80 products. Which seems to be obvious. So setting it to 100 will be also a problem I assume ????

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.