1
votes

I need to make a comparison between two inventories, but I have 6000 products, and I want to get the stocks from the database, to make my comparison faster. The problem is that I could not find the table on the database with this information.

I found on the option "developer mode" that the table is stock_inventory_line but in this table only have the physical inventory that I put, but not the current stocks.

1
Could you specify what are you looking for exactly? Are you comparing in SQL or code and what do you actually compare - result or lines? By default, openERP inventory is in "stock_inventory" and lines are filled after you select warehouse etc and can be found in "stock_inventory_lines. If you already make changes please post them in question so it will be more clear.doctore
@doctore, I think she just wants a database dump of the current stocks.Cristian Ciupitu

1 Answers

1
votes

I assume from the tags on the question you are using openerp 7 you are going to need stock.move, not stock.inventory (stock.inventory is for doing stock takes or stock adjustments as you noted).

You are going to need to mimic the qty_available and virtual_available fields as defined in stock/product.py. These are functional fields and are not stored on the database as is.

To get the stock in a location you basically add up all the stock moves with a destination location (locn_dest_id) of your location and state of done and subtract all the stock moves with a source location (location_id) of your location and state of done.

If you are 8, the table is stock.quant and you just add up all the entries in your location.