# Stock levels SQL request

**URL:** <https://discuss.tryton.org/t/stock-levels-sql-request/4327>\
**Category:** Developer\
**Tags:** stock\
**Created:** [June 16, 2021, 1:26pm UTC](https://discuss.tryton.org/t/stock-levels-sql-request/4327 "2021-06-16T13:26:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylviegar](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/b77776/32.png) [@sylviegar](https://discuss.tryton.org/u/sylviegar)\
**Post date:** [June 16, 2021, 1:26pm UTC](https://discuss.tryton.org/t/stock-levels-sql-request/4327/1 "2021-06-16T13:26:04Z")

</div>

For BI purpose, I need to get current quantity and virtual quantity for each variant, by stock location.  
I can see those quantities in Tryton in products by location screen which are calculated in get\_quantity function, but before trying to reinvent the wheel, I would like to know if someone already worked on a SQL request able to calculate those stock levels by product/location.  
Thanks
