Inventory Valuation Discrepancies
When the inventory valuation report does not match the accounting stock valuation account:
Issues:
- Inventory Valuation report shows $50,000
- GL Stock Valuation Account (1400) shows $47,500
- Difference of $2,500 unexplained
- Products showing wrong unit cost
- Valuation entries missing for some stock movesUnderstanding Inventory Valuation in Odoo
# Odoo offers two valuation methods:
# 1. Manual Valuation — stock moves do NOT create journal entries
# Value is tracked only in inventory reports
# 2. Automated Valuation — stock moves CREATE journal entries
# Value is reflected in the general ledger
# For automated valuation, three costing methods:
# - Standard Price: fixed cost per unit
# - Average Cost (AVCO): weighted average recalculated on receipt
# - FIFO: first-in-first-out cost layers
# Check product category setting:
# Inventory > Configuration > Product Categories
# Accounting tab > Inventory Valuation: Manual or Automated
# Costing Method: Standard, Average, or FIFOFix 1: Identify the Discrepancy Source
# Compare inventory valuation vs accounting:
sudo -u postgres psql -d mydb -c "
-- Inventory valuation (from stock layer)
SELECT SUM(value) as inventory_total
FROM stock_valuation_layer
WHERE company_id = YOUR_COMPANY_ID;
"
sudo -u postgres psql -d mydb -c "
-- Accounting balance (from journal entries)
SELECT SUM(debit) - SUM(credit) as accounting_total
FROM account_move_line aml
JOIN account_move am ON aml.move_id = am.id
JOIN account_account aa ON aml.account_id = aa.id
WHERE aa.code = '1400' -- Your stock valuation account
AND am.state = 'posted'
AND am.company_id = YOUR_COMPANY_ID;
"
# The difference indicates missing or extra journal entriesFix 2: Missing Valuation Journal Entries
# Some stock moves may not have created journal entries
# Find stock moves without accounting entries:
sudo -u postgres psql -d mydb -c "
SELECT svl.id, svl.stock_move_id, svl.value, svl.quantity,
svl.account_move_id, sm.reference
FROM stock_valuation_layer svl
JOIN stock_move sm ON svl.stock_move_id = sm.id
WHERE svl.account_move_id IS NULL
AND svl.company_id = YOUR_COMPANY_ID
AND svl.value != 0;
"
# If entries are missing, the valuation was likely changed
# from Manual to Automated partway through
# Fix: Create manual journal entries for the missing amounts
# Or reprocess the stock moves (complex, may require developer)Fix 3: Standard Cost Changes
# When using Standard costing:
# Changing the standard price creates a revaluation entry
# If the revaluation is not posted, values diverge
# Check for unposted revaluations:
sudo -u postgres psql -d mydb -c "
SELECT id, name, state, date, amount_total
FROM account_move
WHERE ref LIKE '%revaluation%'
AND state = 'draft';
"
# Post all draft revaluation entries
# Or check: Product > Action > Product RevaluationFix 4: Average Cost Rounding
# AVCO recalculates unit cost on each receipt:
# New Average = (Old Value + New Receipt Value) / (Old Qty + New Qty)
# Rounding differences accumulate over many transactions
# This is normal and usually small
# To minimize rounding:
# Use higher decimal precision for cost prices
# Settings > Technical > Decimal Precision > Product Price
# Increase from 2 to 4 decimal placesFix 5: FIFO Layer Issues
# FIFO tracks individual cost layers
# Issues arise when layers are consumed out of order
# Check FIFO layers:
sudo -u postgres psql -d mydb -c "
SELECT svl.id, pp.default_code, svl.quantity, svl.unit_cost, svl.value,
svl.remaining_qty, svl.remaining_value
FROM stock_valuation_layer svl
JOIN product_product pp ON svl.product_id = pp.id
WHERE svl.remaining_qty > 0
AND svl.company_id = YOUR_COMPANY_ID
ORDER BY pp.default_code, svl.create_date;
"
# Negative remaining_qty indicates overconsumption
# This creates valuation layer corrections when new stock arrivesFix 6: Reconcile Inventory to Accounting
# Step-by-step reconciliation:
# 1. Run inventory valuation report:
# Inventory > Reporting > Inventory Valuation
# Export to spreadsheet
# 2. Run trial balance for stock accounts:
# Accounting > Reports > Trial Balance
# Filter to stock valuation accounts (1400, etc.)
# 3. Compare totals:
# If inventory > accounting: missing journal entries
# If accounting > inventory: extra/duplicate journal entries
# 4. For each product with large discrepancies:
# Check the stock move history and corresponding journal entries
# Product > Inventory tab > Valuation smart buttonPrevention
DeployMonkey's AI agent monitors inventory valuation consistency. The agent compares stock valuation layers against accounting entries regularly and alerts on discrepancies before they compound.