Stock problems changing lot in inventory moves

With the stock_lot module activated, after you create a supplier shipment, and mark it as received, the lot field from the incoming move becomes read-only (as the state becomes “done”), while the lot field in the inventory move is still editable, is this behavior intentional?
It can create some problems with the lot stock, as if the lot is changed, you could have negative stock:

Steps to reproduce:

  • install stock_lot module
  • create a supplier shipment
  • create a move with any lot
  • mark the shipment as received
  • change the lot of the inventory move
  • finish the shipment
  • check the lot’s stock

Of course, you are receiving on lot and storing another. So this causes negatives quantities.

Lots can be updated at any time before the move is done. This applies for all kinds of move, no mather if they are related with a shipment or not.

Hi Sergi, thank you for your quick response,
I know that im receiving a product and storing another, the point of the post is to understand why is it possible, not only the lot, also the product, and maybe other fields, why would I store something i am not receiving?
And if this is intentional by any reason, shouldn’t there be a control of the stock values?
Thank you.

For the shake of simplicity I do not think it’s worth to test that the product beeing moved its already in the location it has been moved from.

Normally the system trusts the user. If the users enters some wrong information it is always possible to fix it.

If you are telling the system that you are doing so, why must the system say to you it is not possible?

Since ShipmentIn allows to make any inventory move (#4545) · Issues · Tryton / Tryton · GitLab there is a warning if the quantities between incoming and inventory moves are not the same per product and lot.