Skip to content
Book a consultation
Skip to content

Negative Stock, Positive Trouble: Why Negative Inventory in Odoo Should Never Be Ignored

Negative Stock in Odoo Impact on Inventory Valuation COGS and Manufacturing Costs

Impact of Negative Inventory in Odoo: one should never ignore!

It starts innocently. A salesperson confirms a delivery for goods that “are physically there” but whose receipt has not been posted yet. A production operator clicks Produce on an MO even though the system shows zero components. The stock goes negative, the order ships, everyone moves on.

Months later, the Finance team finds a gross margin that looks too good to be true, an inventory valuation report that does not match the balance sheet, and a Cost of Goods Sold (COGS) account that nobody can fully explain. The root cause is often sitting quietly in the stock report: negative quantity on hand.

This article explains what negative inventory does to Inventory Valuation and Cost of Sales accounts in a business that both trades and manufactures, and closes with a small automation rule to stop it at the source in an Odoo SaaS (online) instance.

Why Negative Stock Is an Accounting Problem, Not Just a Warehouse Problem

With automated (perpetual) inventory valuation, every stock move creates a valuation entry:

  • Receipt: Dr Stock Valuation / Cr Stock Interim (Received)
  • Delivery: Dr Cost of Goods Sold (via Stock Interim Delivered) / Cr Stock Valuation

The value of each move depends on the product cost at that moment. If stock is negative, Odoo still lets the move happen, but it has no real, layered cost to relieve. It uses whatever cost is currently on the product: the last known average, the last purchase price, a standard price, or in the worst case zero.

The result is a ledger that reflects a guess, not a fact.

Trading Business: Wrong COGS or No COGS on Customer Invoices

Consider a trading company that sells a product with no stock on hand.

Scenario A: Zero or Stale Cost on the Product

The product has never been received in the system, so its cost is 0. A delivery of 100 units is validated and the invoice is posted at a sales price of 150 per unit.

  • Revenue booked: 15,000
  • COGS booked: 0 (or a stale, outdated cost)
  • Gross margin shown: 100%

The margin is fictitious. The inventory valuation is also now sitting at a negative quantity with an unreliable value.

Scenario B: The Goods Arrive Later

When the vendor receipt is finally posted, the negative quantity is cleared, but the damage is already done:

  • Depending on the costing method, the correction is posted in the later period, not in the period of the sale. Month 1 is overstated in profit, month 2 is understated.
  • With a Standard price, no retroactive correction is made at all, so the variance silently stays in the books.
  • Invoices, customer margin reports, commission calculations and management decisions made in between were all based on wrong numbers.

What You Will See in Practice

  • Stock Valuation report not reconciling with the Inventory account on the balance sheet
  • Products with a negative value in inventory
  • Unusual gross margin swings between months
  • Auditors asking for explanations on COGS adjustments and revaluation entries

Manufacturing Business: Forced Component Consumption in MOs

Manufacturing makes the problem compound. When an MO is forced to consume components that are not in stock (by marking quantities as consumed or producing anyway), Odoo allows the components to go negative and values that consumption at the current component cost.

Three things go wrong:

  1. Understated finished-good cost. If the component cost is zero or outdated, the MO’s material cost is understated. The finished product enters stock at a cost lower than reality.
  2. Inflated margin on every future sale. The finished product’s cost feeds COGS when it is sold. A wrongly low cost passes straight into the Cost of Sales account.
  3. No clean retroactive fix. When the component purchase is finally received, the negative component quantity is cleared, but the finished goods already produced (and possibly already sold) keep the old, wrong cost. The error is baked into the product cost and into COGS.

A Simple Example

  • Finished product requires 2 units of component C per unit.
  • Real cost of C is 50. System cost at the time of MO is 0 because stock is negative and no receipt is posted.
  • MO produces 100 finished units. Correct material cost: 100 x 2 x 50 = 10,000. Booked material cost: 0.
  • Finished goods are valued too low, and when sold, COGS is understated by up to 10,000.

Add work-center and overhead costs and the cost sheet becomes even less trustworthy, because the BOM cost, MO actual cost and valuation no longer agree.

The Real Cost of Ignoring It

AreaImpact of negative stock
Inventory ValuationWrong or negative asset value, mismatch with balance sheet
Cost of SalesZero or incorrect COGS, distorted gross margin
Period accuracyCorrections land in later periods, so month-end and year-end are misstated
Product costingFinished goods carry understated costs permanently
Decision makingPricing, commissions and profitability analysis are misleading
Audit and complianceHard-to-explain adjustments and revaluation entries

The Fix: Stop Negative Stock at the Source

The best control is a preventive one. In an Odoo SaaS (online) instance you can enforce this without custom modules, using an Automation Rule with a Python code action on stock quants.

Please refer to the video tutorial to learn the business challenges and how this small automation fixes them.

Setup Steps

  1. Enable Developer Mode and go to Settings > Technical > Automation Rules (in some versions: Automated Actions).
  2. Create a new rule on the model Quant (stock.quant).
  3. Set the trigger to On Create and Edit (or On Save), and watch the Quantity field.
  4. Add an action of type Execute Code and paste the code below.
  5. Test in a duplicate or staging database before enabling it in production.

Python Code

for quant in records:
    if (
        quant.product_id.is_storable
        and quant.location_id.usage == 'internal'
        and quant.quantity < 0
    ):
        raise UserError(
            "Negative stock is not allowed.\n"
            "Product: %s\nLocation: %s\nResulting quantity: %s"
            % (
                quant.product_id.display_name,
                quant.location_id.complete_name,
                quant.quantity,
            )
        )

A Note on the location_id.usage == 'internal' Check

Virtual locations such as Vendors, Customers, Production and Inventory Adjustment legitimately carry negative quantities (for example, the Vendors location goes negative every time you receive goods). Without this filter the rule could block normal receipts and MO operations. Restricting the check to internal locations stops only the real problem: your own warehouse going below zero.

What Happens Once the Rule Is Active

  • Validating a delivery order or internal transfer that would drive internal stock below zero is blocked with a clear message showing the product, location and resulting quantity.
  • An MO that tries to consume components you do not have cannot be completed until the stock is received or adjusted.
  • Teams are forced to post the vendor receipt first, which keeps valuation and COGS honest.

Good Practices to Go With the Rule

  • Post receipts on the same day goods arrive. Most negative stock is a timing problem.
  • Review the Inventory > Reporting > Stock view with a Negative Stock filter weekly.
  • Reconcile the Stock Valuation report with the Inventory account at every month-end.
  • Keep product costs updated; never leave a storable product at a zero cost.
  • Train sales and production staff: “the goods are there” is not the same as “the system knows they are there”.

Frequently Asked Questions

Yes. Odoo lets a delivery, transfer or manufacturing order go ahead even when the system shows no stock, so the quantity on hand goes negative. With automated inventory valuation, the move is still valued at whatever cost is on the product at that moment.

The delivery is valued at the product’s current cost, which may be the last average, the last purchase price, a standard price or zero. If that cost is zero or out of date, COGS is wrong or missing and the gross margin is overstated.

Only partly. The negative quantity is cleared, but depending on the costing method the correction lands in a later period, and with a Standard price no retroactive correction is made. Margin reports, commissions and decisions made in between stay wrong.

When an MO consumes components that are not in stock, they are valued at the current component cost. If that cost is zero or outdated, the finished product enters stock too cheaply, and that low cost flows into COGS on every future sale.

Create an Automation Rule on the Quant (stock.quant) model, triggered on create and edit of the Quantity field, with an Execute Code action that raises an error when a storable product in an internal location goes below zero. No custom module is needed.

Virtual locations such as Vendors, Customers, Production and Inventory Adjustment carry negative quantities in normal operations. Limiting the check to internal locations blocks only your own warehouse going below zero, without stopping receipts or MOs.

Yes. Test it in a duplicate or staging database before enabling it in production, as behavior can vary slightly between Odoo versions.

Conclusion

Negative inventory is not a harmless warning. In a trading business it produces wrong or missing COGS and flattering margins. In manufacturing it silently corrupts product cost and carries the error into every future sale. A few lines of code in an Automation Rule can make your inventory data something Finance, Operations and your auditors can all trust.

Stop the minus sign before it reaches your books.

Always test automation rules in a non-production database first, as behavior can vary slightly between Odoo versions.

Book an Odoo Inventory Valuation Review

Techvaria checks your negative stock, product costs, stock valuation against the balance sheet and COGS postings, and helps you set up the automation rule that stops negative inventory at the source.
Mustufa Rahi

Mustufa Rahi is an Odoo Certified Functional Consultant and ERP expert at Techvaria with 15+ years of experience in implementation, automation, and business process optimization, helping organizations scale efficiently.