# Problem in internal shipments with transit location when migrate to 7.0

**URL:** <https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325>\
**Category:** System Administrator\
**Tags:** stock\
**Created:** [May 28, 2024, 10:28am UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325 "2024-05-28T10:28:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmpardo98](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/j/46a35a/32.png) [@jmpardo98](https://discuss.tryton.org/u/jmpardo98)\
**Post date:** [May 28, 2024, 10:28am UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/1 "2024-05-28T10:28:30Z")

</div>

I’ll put you in context. I’m migrate from 5.0 to 7.0 and I have got internal shipments in done state with the same planned date and planned start date but they go from one location warehouse to another location with different warehouse than first. This shipments in 5.0 haven’t got transit location because this location was filled in if the dates are different. In 7.0, this functionality was changed and now the transit location is filled in if the shipment was making between locations with different warehouses. The problem is when I enter in those shipments in 7.0, I can not see their moves because now they have got transit location and in 5.0 they not generate moves to transit location.  
If you have experience the same problem, ¿How could you resolve it?

---

<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:** [May 28, 2024, 11:03am UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/2 "2024-05-28T11:03:56Z")

</div>

If you just look for the moves of a product you will be able to correctly see the move.

One solution may be to perform some SQL queries to duplicate the current moves of such shipments by using the transit location as intermediate moves.

Why do you need to look at the history of intenral shipments?

P.S: Here is the [issue](https://foss.heptapod.net/tryton/tryton/-/issues/5587) which introduced the transit location functionality if you want to dig it depper

---

<div class="post-metadata">

**Author:** ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)\
**Post date:** [May 29, 2024, 9:06am UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/3 "2024-05-29T09:06:00Z")

</div>

> [@pokoli](#):
>
> Why do you need to look at the history of intenral shipments?

Why not? IMHO this change breaks old shipments compatibility.

---

<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:** [May 29, 2024, 9:59am UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/4 "2024-05-29T09:59:40Z")

</div>

> [@sergyo](#):
>
> IMHO this change breaks old shipments compatibility.

Because what is really interesting is the detail, and this is shown on stock moves.  
The internal shipment does not provide any information but just the grouping of the moves.  
Normally when looking at historical data you just search for the moves of a product, which is shown on the stock.move table and this data is already correct.

---

<div class="post-metadata">

**Author:** ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)\
**Post date:** [May 29, 2024, 12:04pm UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/5 "2024-05-29T12:04:28Z")

</div>

> [@pokoli](#):
>
> > [@sergyo](#):
> >
> > IMHO this change breaks old shipments compatibility.
> 
> The internal shipment does not provide any information but just the grouping of the moves.

Well the grouping is a valued information for users.

---

<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:** [May 29, 2024, 12:11pm UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/6 "2024-05-29T12:11:35Z")

</div>

You can see the grouping from the list of moves as the shipment field will be shown.  
AFAIU the problem is just when opening the form view.

---

<div class="post-metadata">

**Author:** ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)\
**Post date:** [May 29, 2024, 1:19pm UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/7 "2024-05-29T13:19:53Z")

</div>

AFAIK the shipment is not available in list of moves.  
Anyway we can continue arguing all the time but it not make senses that a shipment with moves does not show its moves.

---

<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:** [May 29, 2024, 3:47pm UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/8 "2024-05-29T15:47:41Z")

</div>

Another option is:

> [@pokoli](#):
>
> to perform some SQL queries to duplicate the current moves of such shipments by using the transit location as intermediate moves.

And then we can decide if such queries should can be added as migration query.

Altought this feature was added in 4.2 series, I guess the problem is related to a newer change as you did not notice until now. Probably because you did never define any lead time between warehouses. Could you confirm?

In such case this is related to:

> **[Moves of internal shipment are not valid when switching between transit and...](https://foss.heptapod.net/tryton/tryton/-/issues/11745)**
>
> Create a new internal shipment Fill the "From Location" and "To Location" field Fill the "Planned Date", and put a different date in the...

---

<div class="post-metadata">

**Author:** ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)\
**Post date:** [May 29, 2024, 5:05pm UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/9 "2024-05-29T17:05:08Z")

</div>

> [@pokoli](#):
>
> Altought this feature was added in 4.2 series, I guess the problem is related to a newer change as you did not notice until now.

No, the problem is not the transit location but the change on condition to use it or not; and this change was introduced in [6.6](https://discuss.tryton.org/t/tryton-release-6-6/5632).  
Before that the transit location was used only when dates were different.

---

<div class="post-metadata">

**Author:** ![Xavi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xavi](https://discuss.tryton.org/u/Xavi)\
**Post date:** [September 9, 2024, 7:23am UTC](https://discuss.tryton.org/t/problem-in-internal-shipments-with-transit-location-when-migrate-to-7-0/7325/10 "2024-09-09T07:23:17Z")

</div>

Hi, Im facing the issue mentioned in here that after the migration the internal shipments are now not showing their moves because they don’t have a transit location defined, and the shipment has it because of its on\_change\_with update.  
I also think that it makes no sense having a shipment “without” moves, as you cannot see them, even if its an old record the user may want to see anything.  
As I had the `on_change_with_transit_location` already modified on a custom module, I just solved it by returning None when the locations defined are not the transit location, and now I can see the moves of the shipments created before the migration.  
Anyways, I think there should be anything defined on migration section to fix it, probably the SQL queries to duplicate moves and set the correct locations as Sergi says.  
Thanks.
