One of the most complex challenges in Odoo ERP is handling backdated entries and ensuring accurate Cost of Goods Sold (COGS) calculation when inventory transactions occur after period closing. This article presents a comprehensive solution for COGS rerun, backdated entries, and inventory valuation alignment.
The Business Challenge
Consider this scenario: A company receives goods in December but records the transaction in January. When calculating December's COGS, those goods should be included in the valuation. Standard Odoo cannot handle this — it only processes transactions based on the accounting date, not the effective date of stock movement.
- ❌ COGS misalignment between Inventory module and GL
- ❌ Incorrect period-wise profitability reporting
- ❌ Manual adjustments required — error-prone and time-consuming
- ❌ No audit trail for costing changes
- ❌ Batch-managed products lose cost traceability
Our COGS Rerun Solution: 13-Step Process
Establish Average Cost costing method for all products or product categories, applied consistently across all items. This provides the foundation for accurate cost calculation.
All stock movements (both stock-in and stock-out) must record two dates:
- Actual Date — When the transaction physically occurred
- Effective Date — When the transaction should be accounted for
Note: Actual Date remains editable subject to period closure status.
System accurately identifies and records all stock-in and stock-out transactions with corresponding accounting entries for inventory management, including:
- Purchase receipts and vendor bills
- Sales deliveries and invoices
- Internal transfers
- Inventory adjustments (gains/losses)
- Manufacturing orders (raw material consumption & finished goods)
System sorts stock-in transactions by effective date and calculates costs including all landed cost items (freight, insurance, duties, etc.).
- Non-batch products: Transaction-wise average cost calculation
- Batch-managed products: Batch cost based on FIFO selection models
At month-end, COGS process:
- Gathers all stock-out transaction data
- Sorts transactions by effective date
- Records valuation for each stock-out movement with assigned cost rate
System identifies internal transfers (location-to-location movements) and processes them without assigning monetary value — these represent physical movement only, not cost-impacting events.
Using data from Steps 4 and 5, the system recalculates cost rates for each stock-out movement considering effective dates per the FIFO (First-In-First-Out) model of stock-in and stock-out movements.
Based on recalculated rates from Step 7, the system:
- Identifies misalignments in cost rates between recalculated COGS and existing GL entries
- Posts adjustment entries by debiting or crediting COGS account and Stock account based on discrepancy nature
- No manual entries allowed in COGS and Inventory accounts — only automated adjustments
System reconciles stock valuation:
- Non-batch products: Closing stock value using average rate
- Batch-managed products: Batch cost based on FIFO selection models
- Stock adjustments (MI losses/gains) valued at running average
- Manual stock revaluations (value changes without quantity impact) are incorporated
If all preceding steps execute correctly, the value in the financial model aligns perfectly with the closing stock value in the inventory module.
Critical control mechanism:
- Once a period is closed, COGS rerun module cannot work for that period
- System prevents posting entries for closed periods
- After COGS rerun completion, period close is finalized with time limit enforcement
Comprehensive reporting capabilities:
- Period-wise reports — COGS run results by period
- Product-wise reports — Transaction-level COGS details
- Complete logs — Everything happening in COGS rerun with audit trail
- Location-wise reporting — Inventory valuation by warehouse/location
- Advanced filters — Receipts only, Outwards only, Adjustments only
System ensures opening stock values are properly aligned between:
- COGS rerun module opening balances
- General Ledger opening balances
- Historical period carry-forward values
Critical Design Principles
📌 Division, Segment & Station-Based FIFO
All processes operate on division-wise, segment-wise, and station-wise considerations with product as the base. The system implements FIFO models considering transactions by division, segment, and station to ensure closing stock of each category is properly calculated.
📌 No Manual Entries in COGS & Inventory Accounts
The system strictly prohibits manual journal entries affecting COGS and Inventory accounts. All adjustments must go through the automated COGS rerun process to maintain integrity.
📌 Stock Adjustments (MI Losses/Gains)
Losses or gains from stock adjustments are valued at running average cost at the time of adjustment, ensuring accurate impact on inventory valuation.
📌 Stock Revaluation Handling
When stock revaluation increases or decreases value without affecting quantity, the system incorporates these adjustments in COGS run as they impact costing.
📌 Independent Module Philosophy
The COGS rerun module operates independently — it does not correct every entry in Odoo. Instead, it:
- Posts only the difference between COGS run calculation and existing GL account entries
- Ensures the COGS GL account matches COGS rerun module calculation
Pros & Cons: Effective Dates vs Actual Dates
- Provides flexibility for period-specific reporting
- Allows accountants to align transactions with proper accounting periods
- Useful when physical transactions occur near period boundaries
- Supports retrospective corrections without changing physical record dates
- Can create disconnect between physical operations and accounting records
- Risk of manipulation if not properly controlled
- Audit complexity — tracking why effective dates differ from actual dates
- Requires strict governance and approval workflows
- Perfect alignment between physical movement and accounting record
- Simpler audit trail — single source of truth
- No confusion about when transactions occurred
- Better for operational reporting and inventory accuracy
- Inflexible — cannot adjust for period closing boundaries
- Late entries (e.g., goods received after month-end) may be excluded
- May require period reopening for corrections
Our Recommendation
Hybrid Approach: Use Actual Dates as primary with Effective Dates as override only for specific scenarios, subject to approval workflow and audit logging.
The AI decision model automatically selects the appropriate date — Actual Date preferred, Effective Date fallback — ensuring maximum accuracy while maintaining flexibility.
Implementation Architecture
Technical Requirements
- Odoo 14, 15, 16, 17, or 18 (Community or Enterprise)
- PostgreSQL 13+ with proper indexing for date-based queries
- Additional database tables for FIFO queue management
- Custom module with period lock capability
- Audit logging infrastructure
Benefits of This Solution
- Accuracy: Perfect alignment between Inventory module and GL
- Auditability: Complete transaction logs and period-wise reports
- Flexibility: Hybrid actual/effective date model with AI decision support
- Control: Period locking prevents post-close modifications
- Segmentation: Division/segment/station-based FIFO ensures correct costing per business unit
- Batch Traceability: Full FIFO tracking for batch-managed products
We provide custom development for COGS rerun modules, backdated entry handling, and inventory valuation fixes. Our team has implemented this solution for manufacturing, distribution, and retail clients across Kenya, UK, Europe, and Middle East.
Frequently Asked Questions
Does this work with Odoo's standard costing methods?
Yes. The solution works alongside Odoo's standard Average Cost, FIFO, and Standard costing methods, extending them with period-based rerun capability.
How does this handle multi-currency transactions?
The system maintains exchange rates at transaction dates and recalculates COGS based on the effective date's exchange rate.
Can this be used with Odoo's manufacturing module?
Absolutely. The solution tracks raw material consumption, work-in-progress, and finished goods with proper FIFO costing.
What happens if I need to reopen a closed period?
The system supports period reopening with proper authorization and complete audit logging of all changes made after reopening.