Managing inventory efficiently is crucial for businesses of all sizes, especially for those using Odoo for Small Business solutions. When implementing Odoo 18, one of the first steps is to add opening stock to ensure accurate inventory management. This guide will walk you through the process of adding opening stock in Odoo 18 Inventory, providing both standard methods and a custom-coded approach.
Understanding Opening Stock in Odoo 18
Opening stock refers to the initial inventory levels at the start of using the system. Accurately entering these values helps maintain proper stock valuation, reporting, and business operations. Odoo 18 provides multiple ways to add opening stock, including inventory adjustments and stock importation.
Step-by-Step Guide to Adding Opening Stock
1. Configuring Inventory Module
Before adding opening stock, ensure that the Inventory module is properly configured:
- Navigate to Apps and install the Inventory module if it is not already installed.
- Go to Inventory → Configuration → Settings and enable the necessary options like Storage Locations if you manage stock at different locations.
2. Creating Products for Opening Stock
You must first create the products that will have opening stock assigned:
- Go to Inventory → Products → Products.
- Click Create and enter details like Product Name, Product Type (Storable), and Unit of Measure.
- Under the Inventory tab, assign Storage Location and enable Track Lot/Serial Numbers if needed.
- Save the product.
3. Adjusting Inventory for Opening Stock
Now, add stock using the Inventory Adjustments feature:
- Navigate to Inventory → Operations → Inventory Adjustments.
- Click Create, set the adjustment name (e.g., “Opening Stock”), and choose the warehouse/location.
- Click Start Inventory.
- Add products by selecting them and inputting the Counted Quantity.
- Click Validate to confirm the opening stock entry.
4. Importing Opening Stock Using CSV
For bulk stock entry, importing via CSV is efficient:
- Go to Inventory → Configuration → Inventory Adjustments.
- Click Import and upload a CSV file containing columns like Product Name, Quantity, and Location.
- Ensure data mapping is correct before importing.
- Validate the adjustment to update stock levels.
5. Using Stock Moves for Manual Entry
Stock moves allow precise control over inventory adjustments:
- Navigate to Inventory → Operations → Transfers.
- Click Create and enter details such as Source Location (e.g., Virtual Location/Opening Stock) and Destination Location (e.g., Warehouse/Stock).
- Add the products and quantities, then confirm the transfer.
Custom Code: Adding Opening Stock via Python Script
For advanced users, the following Python script can automate opening stock entry using Odoo’s ORM (Object-Relational Mapping):
from odoo import api, models
def create_opening_stock(self):
stock_picking = self.env[‘stock.picking’].create({
‘picking_type_id’: self.env.ref(‘stock.picking_type_in’).id,
‘location_id’: self.env.ref(‘stock.stock_location_suppliers’).id,
‘location_dest_id’: self.env.ref(‘stock.stock_location_stock’).id,
‘move_lines’: [(0, 0, {
‘name’: ‘Opening Stock’,
‘product_id’: self.env.ref(‘product.product_product_4’).id,
‘product_uom_qty’: 50,
‘product_uom’: self.env.ref(‘uom.product_uom_unit’).id,
‘location_id’: self.env.ref(‘stock.stock_location_suppliers’).id,
‘location_dest_id’: self.env.ref(‘stock.stock_location_stock’).id,
})],
})
stock_picking.action_confirm()
stock_picking.action_assign()
stock_picking.button_validate()
This script:
- Creates an inventory transfer for opening stock.
- Moves 50 units of a specified product from the supplier location to the stock location.
- Confirms and validates the transfer.
Conclusion
Adding opening stock in Odoo 18 Inventory is a vital step in ensuring accurate inventory management. Whether using manual inventory adjustments, CSV imports, or automation through Python scripts, Odoo provides multiple ways to streamline the process.
If you need expert guidance on implementing Odoo 18 for your business, consider hiring a professional Odoo consultant. Contact us today to optimize your Odoo experience and enhance your inventory management system!
0 Comments