This question has been flagged
1 Reply
7805 Views

I have a db with many products without their quantities. I need to import ones from csv, but I don't know how to do that by internal reference. It's important.

Avatar
Discard
Best Answer

Assuming you have your stock locations already set up in Odoo (do that first), export all the IDs for locations and product IDs.  They should look something like __export__.stock_location_123  and __export__.product_template_12345.  Next, go to Warehouse --> Inventory Adjustments and create a new record.  Export this record to get the ID, name, and inventoried location ID.  With this data in hand, you can start assembling your CSV file. 

You will need some way to link your Internal Reference field with the Odoo product ID.  We use FileMaker Pro, but I'm sure there are myriad ways of accomplishing this task.  If your stock is divided amongst multiple locations, you'll need to tie your exported IDs in as well.  Once you've got the different pieces tied together, save or export to CSV or Excel.  You should have your Internal Reference (for easy reference, you won't import this), the ID of the location containing X quantity of the product, the product ID (from Odoo), the quantity of the product in the location specified, and the Unit of Measure (must match Odoo!).  Next, edit this file in Excel or OpenOffice Calc.  Add a couple columns at the beginning, and on the first line only, add the exported Inventory Adjustment ID, the Inventory Adjustment name field, and the exported inventoried location ID.

Your column headings should be id, name, Inventoried Location / External ID, (Ref - Don't import), Inventories / Location / External ID, Inventories / Product / External ID, Inventories / Checked Quantity, and Inventories / Product Unit of Measure.  Now save the file in CSV format.

Go back to Odoo and try importing this CSV file in the Inventory Adjustments screen.  Hopefully, Odoo hasn't changed since I last did this!  Your results may vary.  Good luck!  :)

Avatar
Discard