Odoo Version:V9
It appeared to me that Odoo uses table 'Stock_Move' to calculate historical stock level when running "Inventory at Date" report from the menu. It would return incorrect results in the example below.
Suppose there are 20 computures in warehouse location 'WHL1'. And 30 computers in warehouse location 'WHL2'.
1. When I created a outbound delivery for 10 computers, I set the default source warehouse location as 'WHL1'.
2. However when I executed the delivery, I changed the actual source warehouse location to be 'WHL2'. The delivery date was Jan 3.
3. For some reason, table 'Stock_Move' recorded the outbound movement's source warehouse location still as 'WHL1'. And it looks like Odoo uses this table to calculate historical stock level. When I checked the inventory level on Jan 4 by running 'Inventory at Date' report from the menu, I got the result as WHL1 being 20 computers and WHL2 still being 30 computers. However the correct results should be WHL1 20 and WHL2 20.
4. Odoo also recorded the same movement in another table 'Stock_Pack_Operation', which stored the correct source warehouse location - 'WHL2'. It appears to me that Odoo uses this table to obtain current inventory level, hence the results will always be accurate.
My question would be - if my observation is correct, why would Odoo use different tables to calculate current and historical stock level?
We have a business requirement to show historical stock level. We now may have to write our own code to do that, rather than relying on Odoo's built-in report.
Thanks in advance.
If you can reproduce this on runbot (runbot.odoo.com) then please submit a bug at https://github.com/odoo/odoo/issues
Thanks Ray. I have posted issue #16902.