Skip to content

Instantly share code, notes, and snippets.

@simahawk
Created June 13, 2016 14:56
Show Gist options
  • Save simahawk/4577892ff14597e2eb09a8ef31e051f6 to your computer and use it in GitHub Desktop.
Save simahawk/4577892ff14597e2eb09a8ef31e051f6 to your computer and use it in GitHub Desktop.
odoo - stock picking package preparation -> get lot id for each line
picking_ids = line.package_preparation_id.picking_ids.ids
search_args = [
('picking_id', 'in', picking_ids),
('product_id', '=', line.product_id.id),
]
pack_items = self.env['stock.pack.operation'].search(search_args)
lots = []
for item in pack_items:
lots.extend([x.lot_id.name for x in item.pack_lot_ids])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment