Comment 2 for bug 1172694

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : Re: [7.0] do_partial function in partial picking wizard doesn't accept a line without move_id

Well this is a coding issue.

If you look at the method do_partial_picking in file addons/stock/wizard/stock_partial_picking.py

You will see a check if wizard_line.move_id.id is set or not. And then after the test use wizard_line.move_id.id even if it isn't set. So calling the method without move_id will raise the previous error.

Wether it should use move_id instead of wizard_line.move_id.id or check wizard_line.move_id is not null in case of
(picking_type == 'in') and (wizard_line.product_id.cost_method == 'average')

This is for my specific needs but there is obviously an error in this code part.

I think my solution is the best of the two option as I don't see why it would not be allowed to give an empty wizard_line.move_id to force the creation of a new one in case of product reception.