Inventory too slow

Bug #552844 reported by Bruno Hostalery
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Opinion
Undecided
Unassigned

Bug Description

With large stock location (about 2000 locations), and few product ((test base with only 5 products in stock), try to fill inventory.
Server say connexion refused and seems to continue. (cpu charge with nobody working)
About 5 minutes and nothing.
Another way to fill inventory ?

postgresql 8.4
debian 5.0
openerp 5.0.7

Revision history for this message
Bruno Hostalery (istf) wrote :

Confirmation, after 10 minutes, error on serveur with broken pipe.

Revision history for this message
Bruno Hostalery (istf) wrote :

I think the best way is to rewrite ask method to use sql statement.
For example attachment, and by the way, put production lot in it.
In the exemple, 2 new field to add on inventory line :

 _columns = {
  'initial_qty' : fields.float('Initial'),
  'prodlot_id' : fields.many2one('stock.production.lot','Prodution Lot'),
 }

i don't know if it works well with numerous stock, but with my small quantity of products and my big quantity of locations, it works fine.

Revision history for this message
Bruno Hostalery (istf) wrote :

emark on the attachment : problem in second for if key doesn't exist.
Must add a has_key() test to see if we have to make += or = statement

Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :

I have the same problem but I have only one location but 350,000 products.

The client send to me a 'Timeout Error', and the server works for a long time (at least 20 minutes) without response.

Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :

The problem is the _product_get function of the stock.location object. This function try to list all products on the location_id, but my 350,000 products are in the same stock location.

Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :

On stock/product.py, the get_product_available function searches all products if no product ids are given to this function.

I have 350,00 products, so it's more long to search ids of all products.

A solution is to create a table which contains an entry by product/location with the number of products in this location. But this solution ask a big work to update these entries at each stock move.

Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :

I develop a patch to try to gain much working times.

In the fille_inventory function, the _get_product_available was called two times.

I also replace browse method by a read method to gain times.

Changed in openobject-addons:
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → Triaged
philu (philu)
summary: - Inventory too long
+ Inventory too slow
Changed in openobject-addons:
status: Triaged → Opinion
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.