Odoo Help


Automatically select nearest from multiple warehouses

Michael Scorpio
on 9/4/15, 11:12 AM 1,471 views


I'm trying to understand something in the Odoo documentation;

A company has a warehouse in Paris and in Bordeaux. For some orders, you have to deliver the products from Paris, and for others from Bordeaux. But you should also specify a fictitious warehouse that OpenERP uses to calculate whether it should deliver products from Paris or from Bordeaux. To do this in OpenERP, you would create a third warehouse ‘France’ which consolidates the warehouses in Paris and Bordeaux. You create the following physical locations:



        Warehouses France

            Warehouse Paris

            Warehouse Bordeaux

OpenERP will then deliver the goods from the warehouse that has the ordered product in stock. When products are available in several warehouses, OpenERP will select the nearest warehouse. To formalize the notion of distance between warehouses you should use the geographic co-ordinates (X, Y, Z) of the different stores to enable OpenERP to search for the nearest goods. The same co-ordinates could also be used to structure the shelves, aisles and interior rooms in a warehouse.

This would seem to state quite expicitly that I can have multiple warehouses and choose which one to fulfil from based on location. I want UK orders to be fulfilled by a UK warehouse and US orders to be fulfilled by a US warehouse. The question is; how do I implement this?

Michael Aigner
On 5/10/16, 1:35 PM

Michael, did you get this sorted out somehow? I'm also stumbling across this problem at the moment!

On 11/6/15, 1:33 PM

Hello Michael Scorpio,

Following is my suggestion :

On stock warehouse add three fields.

1) field country_group_ids (res_country_group)

2) field country_ids (res_country)

3) field state_ids (res_state)

  • state_ids has a domain on res_country

  • country_ids has a domain on res_country_group

Write a your logic onchange of shipping address in sale order, that select the Warehouse automatically based on the state and country of the shipping address




About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 9/4/15, 11:12 AM
Seen: 1471 times
Last updated: 6/9/16, 11:18 AM