Created
June 13, 2016 14:56
-
-
Save simahawk/4577892ff14597e2eb09a8ef31e051f6 to your computer and use it in GitHub Desktop.
odoo - stock picking package preparation -> get lot id for each line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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