_product_all_get() in stock.location calculates children twice
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
JMA(Open ERP) |
Bug Description
_product_all_get() in stock.location calculates location children with:
location_ids = self.search(cr, uid, [('location_id', 'child_of', ids)])
but later calls "_product_
For example,
* say location ID 1 has 2 children (with IDs 2 and 3)
* say you call stock.location's _product_all_get() with ID 1
This function will call product.product get_product_
and get_product_
child_location_ids = self.pool.
The result is that child_location_ids will always be equal to location_ids. This isn't extremely bad in itself, but if the company created lots (thousands) of locations this search will crash due to the large amount of location_ids.
Please, see the attached patch which fixes this issue. Hope explanation was clear enough, let me know if it wasn't.
Related branches
Changed in openobject-addons: | |
assignee: | nobody → JMA(Open ERP) (jma-openerp) |
milestone: | none → 5.0.11 |
status: | New → Confirmed |
Hello Albert,
It has been fixed by revision 2741 <email address hidden>.
Thank you for reporting and the patch as well.
For 6.0, we will plan to refactor the methods product_get and product_all_get() as they can be combined into a single method with just a change of context.
Thanks.