Odoo Having Double Location Problem (Double Stock Quant)
I was facing a problem that the product having double location, but strangely it's referring to the same location. This is commonly happen in Odoo which are installed on premise (Hosted in your own server). If you kinda confused, here is the image of my problem :
Double location problem |
It's located in Packing Zone, it's has the same location but it has different stocks as picture show above.
Update 29/09/2020 : I called this problem multiple stock quants and you can read the major cause by referring to this link to my other blogpost.
The First Solution :
After struggling for almost three months, the solution is simple. You just need to go to Inventory > Reporting > Report > Current Inventory
Stock calculation |
The system will try to calculate current stock. In result, it only show the current location that has the stock on it, as picture below.
Fixed Inventory Problem |
Update 29/09/2020 :
Somehow if your system has more than 65.000 products in inventory, it will takes more and more time to do the first solution above and most of time it will fail because of timeout processing.
So, another solution is by deleting both stock quant and recreate single quant by inventory adjustment. This can be done by exporting your product that has multiple stock quant, choose the ID of the product, and begin to delete it from backend (postgresql). This can be done by following steps :
First, identify your multiple stock quants. After that, select both of them and make sure there is no reserved stock first or it will cause problems.
Identified products that has multiple quants |
Second, export it by selecting these parameters. Since we are gonna delete both of it, this will help us to extract the ID of the product into excel files.
Known ID of products |
Third step, login to your database. You can refer to this post if you don't know how to.
Fourth, type in the query below :
DELETE FROM stock_quant WHERE id IN (yourExtractedID);
Replace those yourExtractedID by the IDs that you acquired from step number two.
This will delete the multiple stock quant. You can begin to insert your stock normally using inventory adjustment and it will create one normal stock quants.
Update 19/10/2020 :
The problem still persist until 2nd of October, I decided to change the value of nginx timeout and the problem seems solved for two weeks now.