Before the fix, the picking used to create the new stock moves resulting
from changes in the purchased quantity is simply taking the first
available picking of the Purchase. This causes problems when you handle
Purchase Orders with multiple open pickings, as the correct picking to
use when the quantity is updated is not always taken.
After the fix we give priority to evaluate open pickings already related
to the line we are updating. We fallback to the same behaviour as before
is none is available.
closesodoo/odoo#161721
X-original-commit: b3335566a878fd2df29ff02023033acd3cabef70
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>