← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 646224] Re: [5.0][sale] Cancelling an out picking sets the sale order as shipped

 

Hi Jay,

In your patch, you only wrote a condition for picking_ids isn't empty
[], I didn't see any other difference, but, this issue continues
because:

In action_cancel() inheritance of sale module (ids = pickings_to_cancel)
first, it calls to his base (super) method, therefore, 'ids' was set to
state = 'cancel', then, in the inheritance it calls to action_ship_end()
(method that set shipped = 'True' in sale order) if all sale pickings
state are in ['done','cancel'], therefore if sale has one unique picking
and his pick state is done it resets shipped = True or if picking is
cancelled it sets shipped = True in sale (it's the behavior because you
just cancelled a picking (action_cancel())).

The issue is that in cancel state, you shouldn't set shipped = True in
sale. My patch reverses this if statement ('in' instead of 'not in').
Then if all pickings was in cancel or/and done states, it doesn't do
anything, because if all or some pickings are done, sale order already
was shipped = True, and if all pickings is cancelled it doesn't set
shipped=True in sale order.

In your use case (partial pickings), when you cancel any of pickings, it
doesn't set to shipped the sale, patch works for me, if the other
picking was done, and, then when you cancel current picking, you want to
set to shipped=True, you should manage it in this case, but is only in
this case when the original source or your patch works correctly. But,
really, the shipment isn't full.

Thanks for review.

-- 
[5.0][sale] Cancelling an out picking sets the sale order as shipped
https://bugs.launchpad.net/bugs/646224
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: In Progress

Bug description:
Hi,

If I cancel an out picking, it always writes in sale order "shipped=True", because action_cancel() from stock.picking extended in sale module, calls to action_ship_end(), sale's function.

If picking was canceled. In action_ship_end(), it always writes shipped=True except that it finds in the sale, pickings in state different to 'done' or 'cancel',  then when you cancel an out picking the sale order will be shipped and it isn't right.

I include a patch that changes this check, it searches for pickings in the sale with state different to 'done' or 'cancel' for calls to action_ship_end() if it only finds picking in done or cancel  states it doesn't call to function. Reversing the current behavior.