I need to get products available quantity from odoo stock.
There are several models I stock_quant, stock_move, stock_location.
What I am trying to achieve are two things:
- Products total available quantity
- Products available quantity based on location
Can anyone please guide me?
Stock related fields are defines in products (functional field) and directly from the product you can get the stock for all warehouses / locations or for individual location / warehouse.
Example:
For all warehouses / locations
For individual location / warehouse (WAREHOUSE_ID / LOCATION_ID should be replaced by actual id)
Other fields are also there.
You can access all those fields in similar manner. If you will not pass any warehouse / location in context then it will returns the stock of the all warehouses together.
Solution:
For Odoo 8,9 and 10: