Skip to content

Commit

Permalink
[FIX] stock_available : update sublocations computation
Browse files Browse the repository at this point in the history
  • Loading branch information
Laetitia Gangloff committed Aug 5, 2015
1 parent e36f8b7 commit e15a497
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stock_available/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ def _immediately_usable_qty(self):
stock_location_obj = self.env['stock.location']
internal_locations = stock_location_obj.search([
('usage', '=', 'internal')])
sublocation_ids = []
sublocations = self.env['stock.location']
for location in internal_locations:
sublocation_ids.append(self.env['stock.location'].search(
[('id', 'child_of', location.id)]).ids)
sublocations += stock_location_obj.search(
[('id', 'child_of', location.id)])
for product_template in self:
products = self.env['product.product'].search([
('product_tmpl_id', '=', product_template.id)])
quant_obj = self.env['stock.quant']
quants = quant_obj.search([
('location_id', 'in', sublocation_ids),
('location_id', 'in', sublocations.ids),
('product_id', 'in', products.ids),
('reservation_id', '=', False)])
availability = 0
Expand Down

0 comments on commit e15a497

Please sign in to comment.