Managing Supplier Shipment with stock moves in the past in a closed stock period

Hi,

Wondering how to manage such case in Tryton:

  • We purchased a product in May, we are expecting a delivery date in June but nothing happens…
  • Purchase is still processing, there’s no shipment linked to.
  • In August, we closed the stock period of June.
  • Now (in september), our supplier (wake up) and warn us about the delivery of the purchase.
  • So we create the Shipment In, we add the concerned stock moves… but when trying to save the shipment we cannot save because move is in the past and stock period is closed. So move cannot be updated.

How to solve this ? (easy way for a user with limited access rights :wink: )

  • Reopening stock period ?
  • Doing a check when closing a stock period with draft stock moves ?
  • Reschedule incoming moves in the past ?
  • Deleting stock move ?
  • Allowing date update for draft stock moves in the past in a closed period ?

I do not understand why the move is done. If the move is just a forecast you should keep it in draft state and set the done move once received.

That is not blocked by closing periods.

The move is not done. Move is in ‘draft’ state with a planned date in the past.

I see tryton checks the planned_date of the move when checking if the period is closed and this is what is preventing you to create the supplier shipment. I do not know why the system should check the planned date but for me is an error. You should report it as bug.

As workarround, updating the planned date before receiving the shipment should allow you to continue without any code modification.

But move cannot be updated because period is closed. Deleting the move solve the problem because move is recreated without date.

Ok.

Indeed either we should forbid to close a period if there are draft or staging move in that period. But this may be complicated to manage.
Or we do not check for closed period for moves in draft or staging state except if the state is changed. This way we can keep old draft moves and update them.