Skip to Content
Menu
This question has been flagged
3 Replies
4223 Views

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.


Avatar
Discard

If you can reproduce this on runbot (runbot.odoo.com) then please submit a bug at https://github.com/odoo/odoo/issues

Author

Thanks Ray. I have posted issue #16902.

Best Answer

Odoo used Stock_Move to calculate historical stock and used the field date_done in Stock_Move, So check these move if date create different from date_done

Avatar
Discard
Author

Hi Mahmoud,

I think the key thing is that if we deliver something directly from a sub-location e.g. WH/Stock/Shelf 1, instead of WH/Stock, Odoo still incorrectly records the source location of the delivery to be WH/Stock in table Stock_Move. And this table is used by standard reports 'Stock Moves' and 'Inventory at Date', both of which will then return incorrect information.