$ 51.25
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Inventory (stock)
• Invoicing (account) • Discuss (mail) |
Lines of code | 290 |
Technical Name |
stock_historical_import |
License | OPL-1 |
Website | https://www.portoko.com |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Inventory (stock)
• Invoicing (account) • Discuss (mail) |
Lines of code | 290 |
Technical Name |
stock_historical_import |
License | OPL-1 |
Website | https://www.portoko.com |

Historical Stock Import with Valuation
Easily migrate or correct past inventory records with accurate dates and automated costing!

Key Features
- Import stock movements (receipts & deliveries) from user-friendly XLSX files.
- Creates standard Odoo Stock Pickings (Transfers) for each historical operation.
- Precisely sets historical Done Dates on pickings and effective dates on stock moves.
- Ensures imported operations are correctly marked as 'Done'.
- Automatically triggers Odoo's standard mechanisms for creating Stock Valuation Layers.
- Option to create new products on-the-fly during import.
- Handles multiple product lines grouped under a single historical operation reference.
- Simple wizard interface for easy operation.
User Tutorial: Importing Your Historical Stock
Follow these steps to seamlessly add your past inventory movements into Odoo.
Before You Begin: Preparation is Key!
- Backup Your Database: This is a critical first step before any significant data import.
- Module Installation: Ensure the "Historical Stock Import" module is installed from the Apps menu.
-
Configure Product Categories (for new products): If your import file contains products not yet in Odoo and you plan to use the "Create Product if Not Found" option:
- Navigate to Inventory > Configuration > Product Categories.
- Identify or create a category where:
- Inventory Valuation is set to
Automated
. - Costing Method is
FIFO
orAverage Cost (AVCO)
. - All related stock journal and valuation accounts (under "Account Stock Properties") are correctly configured.
- Inventory Valuation is set to
- You will select this category in the import wizard.
- Identify Picking Types & Locations:
- Know which Odoo **Picking Types** (for Receipts and Deliveries) you want to associate these historical moves with (e.g., `YourWarehouse: Receipts`, `YourWarehouse: Delivery Orders`).
- Know your **Default Stock Location** (main physical stock, e.g., `WH/Stock`).
- The **Counterpart Location** usually defaults correctly to `Virtual Locations/Inventory adjustment`.
Step 1: Prepare Your XLSX Import File
Create a spreadsheet with your historical stock data. The **first row must be headers**.
Required Columns & Format:
Header | Description | Example |
---|---|---|
date | Main date of the transaction (YYYY-MM-DD). | 2023-01-15 |
detailed_date (Optional) | Precise timestamp (YYYY-MM-DD HH:MM:SS). If blank, 10:00 AM local time is used. | 2023-01-15 14:35:10 |
reference | Your internal ID for the operation (e.g., old PO/SO number). Lines with the same reference are grouped. | OLD_SO_789 |
product_name | Exact product name in Odoo (or to be created). | Red T-Shirt - M |
qty | Quantity moved (always a positive number). | 10 |
type | Move type: receipt (incoming) or delivery (outgoing). | receipt |
unit_price | Historical cost (for receipts) or sale/transfer price (for deliveries). | 12.50 |
Example Data Snippet:
date,detailed_date,reference,product_name,qty,type,unit_price
2023-01-15,2023-01-15 09:30:00,HIST_PO_001,Wooden Chair,20,receipt,35.00
2023-01-15,,HIST_PO_001,Oak Table,5,receipt,150.00
2023-01-20,,HIST_SO_001,Wooden Chair,2,delivery,55.00

Step 2: Access the Import Wizard
- Log in to your Odoo instance.
- Navigate to the **Inventory** application.
- From the top menu, go to **Operations > Import Historical Moves**.
Step 3: Fill in the Wizard

- Upload XLSX File: Click to upload your prepared
.xlsx
file. - Company: Verify the correct company is selected.
- Default Stock Location: Choose your main stock location (e.g.,
YourWarehouse/Stock
). - Counterpart Location: This usually defaults to
Virtual Locations/Inventory adjustment
. - Receipt Picking Type: Select the Odoo picking type for receiving goods (e.g.,
YourWarehouse: Receipts
). - Delivery Picking Type: Select the Odoo picking type for delivering goods (e.g.,
YourWarehouse: Delivery Orders
). - Create Product if Not Found:
- Check this box if your XLSX contains products not yet in Odoo and you want them created.
- If checked, the Default Category for New Products field becomes mandatory. Select the category you prepared earlier (must be configured for automated valuation).
- Click the Import button.
Step 4: Review the Outcome
- A notification will confirm success or list issues.
- Check server logs for detailed errors if any part of the import fails.
- Verify Data:
- **Transfers:** Go to **Inventory > Operations > Transfers**. You should see new pickings with historical references and dates.
- **Product Quantities:** Check **Inventory > Reporting > Inventory Report**.
- **Valuation Layers:** This is crucial! Check **Inventory > Reporting > Stock Valuation** or search the `stock.valuation.layer` model (in developer mode) to ensure layers have correct historical dates and costs.
- **Transfers:** Go to **Inventory > Operations > Transfers**. You should see new pickings with historical references and dates.
Troubleshooting Tips
- Missing Headers: Ensure your XLSX file's first row has all mandatory headers exactly as specified.
- Date Errors: Double-check date formats (YYYY-MM-DD or DD/MM/YYYY).
- Product Not Found: If "Create Product" is unchecked, ensure names match Odoo exactly.
- No Valuation for New Products: Confirm product type (e.g., 'consu' in Odoo 18) and category settings (Automated Valuation, FIFO/AVCO, accounts).
Important Notes
Always backup your database before performing large data imports.
This module assumes products intended for valuation in Odoo 18 are of type 'Goods' (technical name 'consu') AND are appropriately configured (e.g., correct detailed_type or specific storable flag if applicable in Odoo 18) and belong to a category set for automated valuation. Please verify this aligns with your specific Odoo 18 product setup for storable, valuated items.
Need Help or Have Questions?
For support, feature requests, or bug reporting, please contact us at: micin1603@gmail.com.
Visit our website: PORTOKO.com
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module