📊 Odoo Backdated Entries & COGS Rerun Solution

Complete technical solution for accurate inventory valuation and period closing

May 19, 2025 12 min read Technical Advanced

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.

🎯 Problem Statement: When stock movements (inward/outward) are recorded after a period has been closed, or when effective dates differ from actual dates, standard Odoo COGS calculation fails, leading to inventory valuation mismatches between the Inventory module and General Ledger.

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.

Our COGS Rerun Solution: 13-Step Process

Step 1: Costing Method Establishment
Establish Average Cost costing method for all products or product categories, applied consistently across all items. This provides the foundation for accurate cost calculation.
Step 2: Date Tracking & AI Integration
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
AI Decision Model: The COGS rerun module will prioritize "Actual Date" for valuation. If Actual Date is missing or falls in a closed period, the system falls back to "Effective Date".
Note: Actual Date remains editable subject to period closure status.
Step 3: Transaction Identification
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)
Step 4: Stock-In Valuation & Cost Calculation
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
Step 5: Stock-Out Valuation During COGS Process
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
Step 6: Internal Transfer Handling
System identifies internal transfers (location-to-location movements) and processes them without assigning monetary value — these represent physical movement only, not cost-impacting events.
Step 7: FIFO-Based Cost Rate Recalculation
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.
// FIFO Logic Example // Stock-In Queue: [$100, $110, $105] based on effective dates // Stock-Out (150 units): // First 100 units @ $100 // Remaining 50 units @ $110 // COGS = (100 * 100) + (50 * 110) = $15,500
Step 8: COGS Adjustment Posting
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
Step 9: Closing Stock Revaluation
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
Step 10: Financial Model Alignment
If all preceding steps execute correctly, the value in the financial model aligns perfectly with the closing stock value in the inventory module.
Step 11: Period Close & Lockdown
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
Step 12: Reporting & Audit Trail
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
Step 13: Opening Balance Alignment
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.

// FIFO Segmentation Example // Division: Retail → Segment: Electronics → Station: Store A // Division: Wholesale → Segment: Industrial → Station: Warehouse B // Each combination maintains independent FIFO queue

📌 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:

⚡ Key Insight: The COGS rerun module doesn't recalculate everything — it calculates the delta between what should be in the GL and what currently exists, then posts only the adjustment entries. This makes the process efficient and auditable.

Pros & Cons: Effective Dates vs Actual Dates

✅ Effective Dates — Advantages
  • 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
⚠️ Effective Dates — Disadvantages
  • 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
✅ Actual Dates — Advantages
  • 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
⚠️ Actual Dates — Disadvantages
  • 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

┌─────────────────────────────────────────────────────────────┐ │ COGS Rerun Module Architecture │ ├─────────────────────────────────────────────────────────────┤ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │ │ Stock-In │ │ Stock-Out │ │ Internal Transfers │ │ │ │ Processor │ │ Processor │ │ Handler │ │ │ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │ │ │ │ │ │ │ └────────────────┼────────────────────┘ │ │ │ │ │ ┌───────────▼───────────┐ │ │ │ FIFO Queue Manager │ │ │ │ (Division/Segment/ │ │ │ │ Station/Product/Batch)│ │ │ └───────────┬───────────┘ │ │ │ │ │ ┌───────────▼───────────┐ │ │ │ COGS Calculator │ │ │ │ (Run at Period End) │ │ │ └───────────┬───────────┘ │ │ │ │ │ ┌───────────▼───────────┐ │ │ │ GL Adjustment │ │ │ │ Entry Creator │ │ │ └───────────┬───────────┘ │ │ │ │ │ ┌───────────▼───────────┐ │ │ │ Period Lock Manager │ │ │ └───────────────────────┘ │ └─────────────────────────────────────────────────────────────┘

Technical Requirements

Benefits of This Solution

📞 Need This Solution for Your Odoo Implementation?

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.

Discuss Your COGS Requirements

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.