[ 
http://issues.apache.org/jira/browse/OFBIZ-380?page=comments#action_12443440 ] 
            
Ray Barlow commented on OFBIZ-380:
----------------------------------

Jacopo,

I've found the cause now to be the base work done in r439995 but the killer 
blow is in r440018, where the eca for the processOrderPayments has been 
activated for cancelOrderItem.

OrderServices.processOrderPayments calls "loadCartForUpdate" and the second 
thing that method does is remove all the existing inventory reservations. This 
is OK as the save "saveUpdatedCartToOrder" recreates those reservations as it's 
last job but the processOrderPayments doesn't call "saveUpdatedCartToOrder".

Couple of options I see:
1) add a call to "saveUpdatedCartToOrder" - not sure on the full consequencies 
of this, does it need calling anyway to save the payment changes?!
2) change the "loadCartForUpdate" to support the optional removal of the 
reservations and/or a new "loadCartForPaymentUpdate"

Appreciate any and all comments on this so we can fix it asap. Thanks,

Ray

> Inventory reservation is lost from orders when items are cancelled
> ------------------------------------------------------------------
>
>                 Key: OFBIZ-380
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-380
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: N/A - Tested on clean SVN Win2K JDK 1.5.0_06-b05 Derby
>            Reporter: Ray Barlow
>            Priority: Critical
>
> After going through the following process inventory reservations are being 
> dropped from an open order:
> 1) Starting from a clean demo data install I used the order entry to create 
> an order for admin with two items in the order:
>   GZ-1000 - Tiny Gizmo
>   GZ-1001 - Nan Gizmo
> 2) Push through the order creation process entering a delivery address and 
> payment offline to keep it simple, until the order is created, I didn't 
> bother approving it. You can see the order has invertory reservations and it 
> all looks OK.
> At this point I shut down my app server cleared the log and started up again 
> so I could get a clear list of log actions.
> 3) In the order manager bring up the order and click on "edit items". Then 
> choose one of the products and click "Cancel" at the line level, after which 
> the redrawn screen will show one item cancelled with no allocation (fine) but 
> the other item, still in created state, has also lost it's allocation - major 
> problem!!
> At this point the order can't be processed to completion as packing will fail.
> As a desperate work around you can manually run the "reserveStoreInventory" 
> service through the webtools which will create a new reservation OK. Not 
> really useable when you have lots of line items through!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to