Skip to Content
Menu
This question has been flagged
1 Reply
1873 Views

how can i get  all sale order.lines that currently reserve a product stock-quantity?

Avatar
Discard
Best Answer

Hi,

  

In order to get all sale orders (v12)

stock_move = self.env['stock.move'].search([('reserved_availability', '!=', 0)])
sale_orders = stock_move.sudo().mapped('picking_id.sale_id')

In order to get all sale order lines

stock_move = self.env['stock.move'].search([('reserved_availability', '!=', 0)])
sale_orders = stock_move.sudo().mapped('sale_line_id')
Please make sufficient changes according to your need

    

Avatar
Discard