# Switching warehouse on a draft supplier shipment

**URL:** https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269
**Category:** Ideas
**Created:** [June 15, 2023, 6:56am UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269 "2023-06-15T06:56:16Z")
**Posts on this page:** 12
**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: [June 15, 2023, 6:56am UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/1 "2023-06-15T06:56:16Z")

</div>

Hi,

We sometimes met a problem about the warehouse on the supplier shipment.

Indeed, we order a lot of products in China and it can take some time until order is received in our warehouse. Meanwhile, we could receive another orders and it happens sometime that warehouse is full.  
So we want to switch Warehouse on the supplier shipment to another warehouse but field is become readonly because of incoming moves. Solution would be to delete all moves and then update warehouse.

But, in our case, we already defined the incoming moves following the packing list received from the supplier and we create lots and split some quantities… so there could be many of move lines and recreating them would take a lot of time.

 ![2023-06-15_08-32](https://discuss-cdn.tryton.org/uploads/default/original/2X/3/3aa100a2e80620bc7d1ca49a1fa54074dea7bedf.png)

So, we’ve created a wizard that allow to update the warehouse on a draft supplier shipment and that update the “to\_location” according the selected warehouse on the incoming moves.

Do you face the same problem?

Do you think this functionality could be included in Tryton ? (like “update header” button in sale or purchase)

---

<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: [June 15, 2023, 7:15am UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/2 "2023-06-15T07:15:18Z")

</div>

Why not amend the purchase to change the warehouse?

> [@maxx](#):
>
> Do you face the same problem?

There may be a problem with `account_tax_rule_country` where the warehouse country and subdivision are used to set the taxes (see [Changing warehouse with amendment with taxe rules based on country (#12326) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/12326))

---

<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 15, 2023, 8:14am UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/3 "2023-06-15T08:14:03Z")

</div>

> [@ced](#):
>
> Why not amend the purchase to change the warehouse?

Stock moves are deleted. Supplier shipment is kept with previous warehouse. So you have to do again the work on the incoming moves (splitting, setting lots, …).

> [@ced](#):
>
> There may be a problem with `account_tax_rule_country` where the warehouse country and subdivision are used to set the taxes (see [Changing warehouse with amendment with taxe rules based on country (#12326) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/12326))

Indeed, i didn’t think about Tax. In our case, we switch for a Warehouse in the same area (and then same country too).

---

<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: [June 15, 2023, 8:27am UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/4 "2023-06-15T08:27:46Z")

</div>

I guess we could have in standard such wizard as long as if the `account_tax_rule_country` is activated, it warns about changing warehouse with different country and subdivision.  
Such wizard could be generic and works for supplier and customer shipments.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [June 15, 2023, 1:28pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/5 "2023-06-15T13:28:37Z")

</div>

> [@ced](#):
>
> Such wizard could be generic and works for supplier and customer shipments.

Then probably the split wizard can be reused by just adding a warehouse field to decide the warehouse for the new moves.

We’ve implemented that as customization for spliting customer shipments in one of our deployments.

---

<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 15, 2023, 1:40pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/6 "2023-06-15T13:40:23Z")

</div>

> [@pokoli](#):
>
> Then probably the split wizard can be reused by just adding a warehouse field to decide the warehouse for the new moves.

Hum, not sure to understand. In our case, our moves are already split and a lot is assigned for each move.  
How would you update with the wizard, doing a split of 1 and updating the warehouse ?  
Split button is not on Supplier Shipment.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [June 15, 2023, 1:57pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/7 "2023-06-15T13:57:15Z")

</div>

> [@maxx](#):
>
> How would you update with the wizard, doing a split of 1 and updating the warehouse ?  
> Split button is not on Supplier Shipment.

Yes, the split wizard is only on customer shipments, which was our use case. But as

> [@ced](#):
>
> Such wizard could be generic and works for supplier and customer shipments.

I’m wondering if it makes sense to resue the existing wizard (and make it available for supplier shipments also) instead of creating a new one.

If you split a shipment and select all the moves, select the new warehouse and you have changed the warehouse of the shipment 😉

---

<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 15, 2023, 2:04pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/8 "2023-06-15T14:04:00Z")

</div>

Yes, could be done this way. So this feature will be linked to the stock\_split module and split action will be no more just ‘split’ but ‘split or update warehouse’.

I’ve started the code with a new wizard. I’ll halt now, waiting for the way it should be implemented (added on split wizard or a new wizard).

---

<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: [June 15, 2023, 2:46pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/9 "2023-06-15T14:46:08Z")

</div>

I do no like to merge two different needs into one wizard.

But on a second thought, I’m wondering if it really makes sense to change the warehouse on the shipment (instead of using the amendment).

For the supplier case, the supplier had receive an address to delivery the goods which is the warehouse address. So if you change it, you must inform the supplier because he has to deliver somewhere else. So an amendment seems to be the right thing.  
If the the 2 warehouses are at the same address, I think they should be only one warehouse divided.

For the customer case, I think it is more about having the proper warehouse defined on the sale line so the shipment has the correct warehouse from the beginning. This would prevent the need to amend the sale to change the warehouse.

---

<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 16, 2023, 7:39pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/10 "2023-06-16T19:39:14Z")

</div>

> [@ced](#):
>
> For the supplier case, the supplier had receive an address to delivery the goods which is the warehouse address. So if you change it, you must inform the supplier because he has to deliver somewhere else. So an amendment seems to be the right thing.  
> If the the 2 warehouses are at the same address, I think they should be only one warehouse divided.

As I said, in case of amendment, all the work done on the draft shipment (split, lots assigning, …) is lost. In our case, the supplier doesn’t care of this change of warehouse (he must deliver by boat to Anvers). Then we take in charge the carrier to deliver to the warehouse. By default, it’s our warehouse but as I said, sometimes our warehouse is full and then we need to ship the goods to another warehouse (having another address near our warehouse) that we rent.

I just suggest our problem to the community. If nobody met the same problem, let’s keep the amendment to update the warehouse and on our side, we’ll use our custom wizard to update the warehouse 🙂

---

<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: [June 17, 2023, 1:00pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/11 "2023-06-17T13:00:24Z")

</div>

For me it is strange that you already have the shipment created but did not receive the goods.  
Also in some way you have to tell that the delivery address has changed, maybe not to the supplier but at least to the carrier. So for me amendment is still the best option.

---

<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 17, 2023, 1:50pm UTC](https://discuss.tryton.org/t/switching-warehouse-on-a-draft-supplier-shipment/6269/12 "2023-06-17T13:50:15Z")

</div>

> [@ced](#):
>
> For me it is strange that you already have the shipment created but did not receive the goods

We receive the packing list by email as soon the shipment is on the boat. It take approximatively 1 month to arrive in Belgium. During this time, we prepare the shipment reception following the packing list (split quantities, lot creation). One packing may result of more than 50 lines of incoming moves.

> [@ced](#):
>
> Also in some way you have to tell that the delivery address has changed, maybe not to the supplier but at least to the carrier. So for me amendment is still the best option.

Indeed we have to tell to the carrier that the warehouse has changed.
