Skip to content

Commit

Permalink
[FIX] sale_stock_ux: reserved quantity widget
Browse files Browse the repository at this point in the history
closes #570

Signed-off-by: Nicolas Mac Rouillon <[email protected]>
  • Loading branch information
matiasperalta1 committed Sep 6, 2022
1 parent 102406a commit cccb298
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sale_stock_ux/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SaleOrderLine(models.Model):
def _compute_total_reserved_quantity(self):
for line in self:
loc_id = line.order_id.warehouse_id.lot_stock_id.id
stock_quants = line.product_id.stock_quant_ids.filtered(lambda x: x.location_id.id == loc_id)
stock_quants = self.env['stock.quant'].search([('product_id', '=', line.product_id.id), ('location_id', 'child_of', loc_id)])
line.total_reserved_quantity = sum(stock_quants.mapped('reserved_quantity'))

@api.depends('qty_delivered', 'quantity_returned')
Expand Down

0 comments on commit cccb298

Please sign in to comment.