Purchase amendment and recreation of lines

Scratching my head on a use case that I’m not sure we’re seeing what we’re intended to.

  • initial purchase with two lines of some suppliers products with quantity & price, validated and confirmed
  • later we realised that the order was in error and cancelled, so in shipment tab of purchase the two lines where cancelled
  • now, in 5.4 I install amend_purchase, then add an amendment to set these lines to qty=0
  • in the purchase, after processing and refreshing, the quantities indeed go to 0
  • but when invoking process exception, it indicates that it will recreate the shipment lines
  • in the shipment tab it shows the initial quantities with state cancelled and exception state recreated
  • but if i relate to shipments and try to create a shipment to import any lines from this supplier, none are presented (as one would expect with qty=0)
  • also, if I back out and look at the purchase order, I see the revision number noted with an amount of 0€ and state done (invoice state none and shipment state received!?)

Perhaps there are some loose ends?

Hello, can you tell us what result you expected instead ?

Sure, I would expect the quantities to match the purchase ( 0 ) in the shipments, or even that the lines disappear (as there no movements with qty=0)

Also, shipment state = received is not exact, how can one receive nothing?
There is no movement to materialise that state.

Finally, now that the exception is handled, I would expect to be able to simply cancel, or delete, this purchase, but there seems to be no apparent way to do that (any hints?)

Not sure I would prefer the way you propose.
I don’t like lines which disappear as a general rule.
For me Received means “nothing else is expected”, and you can have received nothing.
I also think that balancing any action by its opposite is better than simply cancel or delete and it respects traceability through periods and history.
On the other hand, maybe internals could be hidden to the user and covered by a “cancel” external look-like.

Received in this context means that the shipment has been physically received.
In this particular case, no materiel has been received on this order, and since the amendment there is no outstanding shipment move in processing either.

IMHO, if we start munging the physical and conceptual terms in logistics, it becomes unmanageable.

BTW, I’m still bewildered as to why there it seems impossible to ‘cancel’ the order prior to physical delivery as we rather encounter this need quite frequently for many reasons.

Also, in commercial terms, the parties may always agree bilaterally to nullify an order, and in some cases unilaterally.

I’ve implemented a solution like this for several customers to ease the cancelation of a purchase/sale. What we do in this cases is cancel all pending moves/invoices and ignore the exception for them.

But I’m not sure if everybody has the same behaviour in this case

Hi @pokoli,

That is exactly what I need. Is there any module for this feature?
Thanks!
Jerónimo

We do not have any generic module that includes only this feature, but probably the best is to create a new topic explaining your needs so we can discuss the inclusion as standard feature.

Basically it’s what you described, something like sale_cancel_pending
With sale_amendment now you can do the same but it’s a very long process when you need just to cancel all the pendings. Instead, an amend it’s a very useful tool when you need to change some price, or some qty.
I’m going to try writing something about the new module propose.

Here it is.