Odoo Help


OpenERP 7 -> Odoo 8: product: get_product_available

Harald F
on 9/29/15, 10:54 AM 1,423 views

I can´t find the function get_product_available in Odoo 8.0.

How can  i get the available quantity for a specific product in a specific location on a specific date in Odoo 8.0?

OpenERP 7 function call:

qty = product_obj.get_product_available(cr, uid, [product.id], context ={'location' : location_id.id, 'states': ('done',), 'what': ('in', 'out'), 'to_date': to_date })[product.id]



| 6 5 7
Lodz, Poland

On 9/29/15, 2:48 PM

In Odoo 8 you analyze model stock.quant. For example fetch all quants  and sum quantity.

quants = self.env['stock.quant'].search([('location_id','=',self.id),('product_id','=?',FOO_ID)])
for quant in quants:
     qty += quant.qty

Your solution sums up the current quantity in that location, i need the quantity on a specific date.

Harald F
on 10/5/15, 6:26 AM

I gave an example only. See how works stock.hostory report, file stock_account/wizard/stock_valuation_history.py

on 10/5/15, 6:51 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/29/15, 10:54 AM
Seen: 1423 times
Last updated: 9/29/15, 2:49 PM