odoo/odoo — pull request #3139 by jordillinares (2014-10-17 08:15:56+00:00)
Title: [FIX] location get_warehouse method does not compute the correct warehouse id.

I'm calling *get_warehouse* from a custom development and I've noticed that it does not always return the expected warehouse id.

To reproduce:
1. Create two more warehouses besides the default one. Odoo creates a default stock location for each new warehouse.
2. From anywhere in your code, call *get_warehouse* for the stock location of the last created warehouse. It won't return its 'parent' warehouse.

I think the problem is the comparation between a left_parent and a right_parent.