Odoo Help


This community 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.


OpenERP 7 -> Odoo 8: product: get_product_available

Harald F
on 9/29/15, 10:54 AM 766 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]



| 5 4 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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