This question has been flagged
2 Replies
3017 Views

My use case is a little strange, but here's part of how we would like our inventory to work:

We have an ebay store and have written software to download our active items to import into the inventory. Initially we were looking to just do a simple CSV import, but found that we can't import quantity and this would've introduced problems with items that change. We added database access to our program to dump the active items directly into Odoo's database. This is working fine for the most part, except the On Hand Quantity does not always reflect what the database reports.

When importing initially, it is correct, but when we update the quantity (through the database, through odoo, through selling an item), it breaks and gives a seemingly random number in return.

The tables that we change when importing data are in this order:

  1. product_template

  2. product_product

  3. stock_inventory

  4. stock_quant

Is there just a table that we're forgetting to update, or is it something to do with how it calculates quantity? If it's the latter, where can I change that? We have no need for the system to calculate the quantity, just deduct when we sell.


Avatar
Discard
Best Answer

Yes, look at the stock_move table  The quants are related to the moves which is where everything happens.  

Having similar issue with migrating from Open ERP 7 which did not have stock_quant we are having to create the stock_quants and relate them to the moves on import to Odoo 9.

 

Avatar
Discard
Best Answer

Turn on SQL logging and watch which queries are run when you update the quantity on hand via the User Interface.  Then you can ensure the tables you update during import are the ones Odoo was programmed to work with and that your database is in a consistent state.

Avatar
Discard