Skip to content

Instantly share code, notes, and snippets.

@rvalyi
Created May 5, 2010 17:27
Show Gist options
  • Save rvalyi/391130 to your computer and use it in GitHub Desktop.
Save rvalyi/391130 to your computer and use it in GitHub Desktop.
ids=StockPicking.search([['state', '=', 'confirmed']])
ids.each do |id|
puts "************** #{id}"
p=StockPicking.find(id)
p.force_assign
w=p.old_wizard_step('stock.partial_picking')
lines=w.open_object_resources[0].relations['move_lines']
h={}
lines.each do |move_id|
h["move#{move_id}"] = StockMove.read(move_id, ['product_qty'])["product_qty"]
end
w.split(h)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment