Hi, i am using odoo v. 11 with lot number traceabilty. I'll explain what i need to do first, and give my interpretation on how i think i should proceed... i'll keep my direct questions at the end of the post for clarity.
I am migrating a big legacy db to odoo, and i already imported products, contacts, lot numbers, purchase and sale orders. So, every line in an order/sale order has a reference to its respective lot number, but there is still no traceability info linked to that lot.
The legacy DB contains a table of 'stock movements' which should be easy enough to translate to odoo 'moves' (at least i hope so).
Let me say for example that for a specific lot number there is this very simple scenario:
move A: 10 units of product XYZ from the vendor to the warehouse
move B: 5 units of product XYZ from the warehouse to a customer
move C: 5 units of product XYZ from the warehouse to another customer
What happens to quants? I guess that odoo would normally try to do the following:
- when elaborating move A, it looks if there's already a quant with product_id = my product, lot_id = my lot, company_id = my company, and with location_id="vendors", and if so it updates it by *subtracting* the right amount (10). Also, it looks for another line with the same (product, lot, company) tuple but with location="stock" and it *adds* 10 to the value. If such lines do not exist in the stock_quant table, they are created.
- when elaborating move B, the same happens but the line with location="stock" is subtracted by 5, and the same value is added to the location="vendors" line.
- the same happens when elaborating move C (location="stock" is subtracted by 5, and the same value is added to the location="vendors" line).
In more complex situations (internal movements from a warehouse to another) the same principle i guess can be applied: subtract from the WH the item is exiting from, and add to the WH the item is going to.
Questions
Is my description of the underlying mechanisms of moves/quants correct? I'd like to be sure i understood how such things work before starting importing stuff like mad :)
I guess there is no 'import moves' or 'import quants' page on odoo, so i think i'll have to import all my existing data by means of direct sql queries. Is there something I should be aware of? (e.g. other tables that need to be updated and I didn't mention, etc)
I saw that the stock_move table has a reference to the stock_picking table. I guess I should I add a new line on the picking table for each purchase order? Or is it possible to create one big "dummy picking" i can make all the imported purchases refer to?
Thank you as always for any help.