← Back to team overview

openerp-community team mailing list archive

Re: missing sort and filter features

 

Le 24/01/2014 19:02, Serpent Consulting Services a écrit :
Today, one nice commit has been pushed which allows us to search stock
qtys on product:

http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-wms/revision/9522

Hi,

I watched this commit and I'm afraid of performance issues with a lot
of products (10,000 or more) when I read this:
    product_ids = self.search(cr, uid, [], context=context)
    ids = []
    if product_ids:
#TODO: use a query instead of this browse record which is probably making the too much requests, but don't forget
        #the context that can be set with a location, an owner...
for element in self.browse(cr, uid, product_ids, context=context):
            if eval(str(element[field]) + operator + str(value)):
                ids.append(element.id)

I saw the TODO but the problem is the context in this case. I've no
other solution to propose but I think it's not a good way.

Maybe we can look for other solution as cache values (by product /
location / prodlot…) computed periodically or at each stock move
creation/modification.

Regards,

--
Quentin THEURET

TeMPO Consulting
20, Avenue de la paix
67000 Strasbourg
France

http://www.tempo-consulting.fr
Tel : +33 3 88 56 82 18
Fax : +33 3 88 56 46 64


Follow ups

References