# Customizable default warehouse

**URL:** <https://discuss.tryton.org/t/customizable-default-warehouse/1401>\
**Category:** Feature\
**Tags:** stock\
**Created:** [May 20, 2019, 2:18pm UTC](https://discuss.tryton.org/t/customizable-default-warehouse/1401 "2019-05-20T14:18:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)\
**Post date:** [May 20, 2019, 2:18pm UTC](https://discuss.tryton.org/t/customizable-default-warehouse/1401/1 "2019-05-20T14:18:54Z")

</div>

## Rational

Currently Tryton has a default warehouse if there’s only one set.  
For a company having multiple warehouses, you’ll have to select the correct warehouse each time this information is needed (sale, purchase, product quantities, …) and most of the time there’s a warehouse you select more than the others (depending of some criteria).  
Example: a company could have warehouses in multiple countries. Company users of a specified country will often, by default, use the warehouse of their country.

## Proposal

The idea would be to define a generic method that deliver the default warehouse.  
First proposal would be to return a default warehouse set on the user.  
This method could be customized and extended to different cases: per company, per employee, per shipping address, per customer/supplier,…

## Implementation

> **[Define a global method to set default warehouse and add to user's preferences...](https://foss.heptapod.net/tryton/tryton/-/issues/8396)**
>
> Following https://discuss.tryton.org/t/customizable-default-warehouse/1401

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [May 20, 2019, 5:01pm UTC](https://discuss.tryton.org/t/customizable-default-warehouse/1401/2 "2019-05-20T17:01:03Z")

</div>

> [@maxx](#):
>
> This method could be customized and extended to different cases

As it is for default value, I think the only possible customization is using data from the context.

> [@maxx](#):
>
> per shipping address, per customer/supplier

This should be managed by `on_change` on the sale.

---

<div class="post-metadata">

**Author:** ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)\
**Post date:** [June 4, 2019, 4:13pm UTC](https://discuss.tryton.org/t/customizable-default-warehouse/1401/3 "2019-06-04T16:13:59Z")

</div>

> **[Define a global method to set default warehouse and add to user's preferences...](https://foss.heptapod.net/tryton/tryton/-/issues/8396)**
>
> Following https://discuss.tryton.org/t/customizable-default-warehouse/1401

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [September 21, 2019, 4:00pm UTC](https://discuss.tryton.org/t/customizable-default-warehouse/1401/4 "2019-09-21T16:00:02Z")

</div>

Closed on September 21, 2019, 4:00pm UTC

This topic was automatically closed after 13 days. New replies are no longer allowed.
