← ClaudeAtlas

odoo-valuation-repairlisted

Diagnose and repair broken inventory valuation on AVCO/FIFO products — negative or absurd standard_price, a stock.valuation.layer book that drifted from physical stock, per-lot (lot_valuated) books torn by mid-stream config flips. Use when a product shows cost ≤ 0 (or a nonsense huge / repeating-decimal cost) while stock is on hand, when Σ SVL quantity ≠ valued on-hand quantity, when COGS posts at garbage unit costs, before/after changing a category's cost method or valuation, or when enabling per-lot valuation on a product that already has history. Covers the read-only RCA query ladder, a fail-closed per-lot repair runbook (shell / server action / RPC-driven, SaaS-safe), and a daily drift check that also catches the silent victims whose cost is wrong but still positive. Also covers the purchase-side variant — a receipt booked at a wrong unit cost (a UoM / decimal slip, classically ×1000) that leaves book quantity perfectly matching physical (so the drift check passes) yet an absurd AVCO, which a full goods r
tuanle96/odoo-ai-skills · ★ 4 · AI & Automation · score 62
Install: claude install-skill tuanle96/odoo-ai-skills
# Broken inventory valuation — diagnose, repair, prevent **The invariant:** for every storable product, `Σ stock.valuation.layer.quantity` (the *book*) must equal physical stock in **valued** locations (`internal` + company-owned `transit`, mirroring `stock.location._should_be_valued()`). The displayed AVCO cost is just `value_svl ÷ quantity_svl` — when the book drifts, the denominator hovers near zero and the "cost" becomes noise: negative, absurdly large, and swinging on every move. **A negative cost is never the disease — it is the visible symptom of a broken book.** Products whose garbage cost happens to still be *positive* are the silent majority (a repeating decimal like `505352.312312…` betrays a tiny denominator). Any monitor that only alerts on `standard_price <= 0` misses them; the drift check below does not. Targets Odoo 17/18 (18 specifics flagged). SaaS-safe: everything here runs through XML-RPC + a server action — no shell or SQL console needed on the target. ## Diagnose (read-only, ~15 min) Run the ladder in order — each answer narrows the next question: 1. **Formula check.** Read `quantity_svl`, `value_svl`, `qty_available`, `standard_price` on the product. `standard_price == value_svl / quantity_svl` with a tiny (or negative) `quantity_svl` while `qty_available` is large ⇒ drift confirmed. The number changing hour to hour is the same symptom (denominator near 0), not "the cost moving". 2. **Counterpart mass.** `read_group` quants by `locatio