Issue 11626

Title
Changing drop shipment quantity on customer_moves results to an empty origin
Priority
bug
Status
testing
Nosy list
acaubet, ced, pokoli
Assigned to
Keywords

Created on 2022-08-04.11:43:58 by acaubet, last changed 3 weeks ago by ced.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-09-15.22:06:49

On more note, there is no real use case where the customer quantity are updated and not the supplier quantity. And as the customer quantity are updated from the supplier quantities, there is no reason for the user to do that.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-09-15.22:05:39

For me the analysis is wrong.
If you reduce the quantity on the customer moves but not on the supplier, it is normal that a new customer move is created when the supplier moves are done. This is done by ShipmentDrop_get_customer_move and the new customer move is still linked to the drop shipment but of course it has no origin because the system can not know from where comes the extra quantity. So clearly there are no new drop shipment created at this point.
Now once the drop shipment is done, the sale detects that not all the quantity has bee shipped so it create a remaining stock move. As there was already a purchase request, this stock move is for the standard sale workflow and no more for a drop shipment, so it is linked to a customer shipment.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-08-04.11:56:23

What is the behaviout on Customer Shipments? Can we follow the same behaviour?
I mean if the user updates the outgoing moves of the customer shipment what happens with inventory moves?

Author: [hidden] (acaubet)
Date: 2022-08-04.11:43:58

Related to issue10430.
If the user change quantity of customer moves sending less units on drop shipment results in a new drop shipment (if remain quantity) with remaining units but without the origin on the customer moves.
If the user split customer moves on drop shipment results in a new splited move with no origin.
Only modifications on supplier moves are supported by now if you don't want to lose origins.

You can test with:

--- a/tests/scenario_sale_supply_drop_shipment.rst      Mon May 02 17:45:46 2022 +0200
+++ b/tests/scenario_sale_supply_drop_shipment.rst      Thu Aug 04 11:22:35 2022 +0200
@@ -193,13 +193,13 @@

     >>> set_user(stock_user)
     >>> move, = shipment.supplier_moves
-    >>> move.quantity = 100
     >>> move.unit_price
     Decimal('3.0000')
     >>> move.cost_price
     Decimal('3.0000')
     >>> shipment.click('ship')
     >>> move, = shipment.customer_moves
+    >>> move.quantity = 100
     >>> move.unit_price
     Decimal('10.0000')
     >>> move.cost_price

How to reproduce:
a. Create a Drop shipment (send x units)
b. On shipment, reduce the quantity to send on customer moves (x-1)
c. > Ship
Result:
A new drop shipment with supplier and costumer moves but it's only related to the purchase and not to the sale because customer moves don't have origin.

Which should be the solution? Sync moves? Blocking user change of customer moves?

History
Date User Action Args
2022-09-15 22:06:49cedsetmessages: + msg78167
2022-09-15 22:05:39cedsetmessages: + msg78166
nosy: + ced
status: chatting -> testing
2022-08-04 11:56:23pokolisetmessages: + msg77561
nosy: + pokoli
2022-08-04 11:43:58acaubetcreate