Skip to main content
iVentureTeam
Odoo Inventory & Logistics

Odoo: Prevent Selling Archived or Out-of-Stock Products in 19 and 20

Stop Odoo 19 and 20 selling archived or out-of-stock products: what archiving misses, sale warnings, eCommerce stock blocks and automation rules that work.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
November 26, 202612 min read0 views
Odoo: Prevent Selling Archived or Out-of-Stock Products in 19 and 20 cover

Many teams archive a discontinued product and assume the job is done, then find it on a confirmed order a week later. Closing every gap usually takes a small, well-tested change, which is the kind of work our Odoo customization services handle every month.

Related service: Odoo for logistics — shipping, tracking and warehouse operations in one place.

This guide is for sales managers, inventory leads and Odoo admins on Odoo 19 or 20 who want hard stops instead of hopeful warnings. If you are deciding how far to customize in general, start with our ultimate guide to Odoo customization.

Why do archived products still get sold in Odoo?

Archived products still get sold because archiving hides a product from search, but it does not remove it from orders that already exist. Odoo treats archiving as "stop offering this", not "forbid this everywhere".

When you archive a product, Odoo excludes it from the product search on a new order line. A salesperson typing the name will not find it. That covers most day-to-day selling.

Four paths still let it through:

  • Open quotations: a draft or sent quote created before you archived the product still contains it and can be confirmed.
  • Duplicated orders: a rep who duplicates last year's order for a repeat customer copies the archived lines with it.
  • Imports and integrations: a file import or connector that references the product by its ID can still write it onto an order.
  • Variants: archiving one variant leaves the template and its other variants on sale, which surprises teams that expected the whole product to go.

Odoo 19 and 20 do flag the first two. The order form shows "Warning: This quote contains archived product(s)" on draft and sent quotes, and each affected line gets a "This product is archived" icon. The warning is visual only. The Confirm button still works.

What is the difference between archiving and untick "Sales"?

Archiving retires a product everywhere, while unticking the Sales checkbox stops it being sold but keeps it alive for purchasing, manufacturing and stock. Pick the one that matches what the business actually wants.

Odoo's own documentation says any product with the Sales checkbox ticked can be sold with the Sales app. In Odoo 19 and 20 the product field on a sales order line only offers products where that box is ticked.

SituationArchive the productUntick "Sales"
Product is fully discontinuedYesNot enough on its own
Still used as a component in a BOMNo, it breaks planningYes
Still bought for internal useNoYes
Stock left to count or scrapArchive after stock is zeroYes, until stock is cleared
Replaced by a newer modelYes, after open orders are handledYes, during the changeover
Should vanish from reports and searchYesNo, it stays visible

A safe phase-out order is: untick Sales, clear open quotes, sell or scrap remaining stock, then archive. Archiving a product with stock on hand hides quantities from daily searches, which later shows up as a stock discrepancy at cycle count.

Which Odoo setting stops which kind of sale?

Odoo 19/20 sales blocks: Which setting stops which sale?

No single setting blocks every bad sale: each standard option covers one channel or one risk, and only a confirm-time check covers them all. Use this table to see where your gaps are.

MethodCoversBlocks or warnsAvailable in
Archive productNew lines in Sales, POS, websiteHides onlyAll editions
Untick "Sales" checkboxNew sales order linesHides onlyAll editions
Sales order line warningOne product, every new lineWarns only (19/20)Sales Warnings setting
Availability icon on lineTracked products in SalesWarns onlySales with Inventory
eCommerce "Continue Selling" offWebsite ordersBlockseCommerce
Odoo 20 unpublish out-of-stockWebsite catalogHides until restockedeCommerce, Odoo 20
Automation rule at confirmationEvery channel that confirms ordersBlocksAutomation rules, Execute Code
Custom module checkEvery channel, including APIBlocksOdoo.sh or on-premise

Standard Odoo is generous by design: it would rather warn than lose an order. If you need a hard stop, add it at the moment of confirmation.

Can Odoo 19 or 20 block a product with a sales warning?

No, Odoo 19 and 20 only show a warning text on the order line; the Blocking Message option from Odoo 18 and earlier is gone. Teams that relied on it after an upgrade often discover this the hard way.

In Odoo 18 the product's Sales tab had a "Sales Order Line" warning selector with three values: No Message, Warning and Blocking Message. Blocking stopped the product being added at all. In Odoo 19 that selector was replaced by a single "Sales Order Line Warning" text field.

The text still pops up when a salesperson adds the product, and the line is highlighted. It suits messages such as "Discontinued, offer model X200 instead", but it cannot stop the order being confirmed.

If you used Blocking Message in Odoo 18, check those products after upgrading: they are on sale again with only a message in front. An automation rule, covered below, is the closest replacement.

Does Odoo block a sales order when stock is not available?

No, Odoo Sales does not block confirmation when stock is short; it shows a red availability icon on the line and lets the order through. This is deliberate, so backorders and replenishment can handle the gap.

For products with Track Inventory enabled, each quotation line shows a small chart icon. It turns red when the forecast cannot cover the line. Click it to see the forecasted quantity on the delivery date and the quantity available after planned operations.

Users ask for a hard stop often. One Odoo 18 user on the forum asked how to block a sales order when a product has zero stock and found no setting for it. A reply noted that Odoo does not block by default and pointed to automatic replenishment instead.

Before you block, decide which number counts as "in stock":

  1. On hand: what is physically in the warehouse now, including stock already promised to other orders.
  2. Free quantity: on hand minus what is reserved for other deliveries. This is usually the right number for a block.
  3. Forecasted: free quantity plus expected receipts up to the delivery date. Use it when you sell against incoming purchase orders.
  4. Per warehouse: if you run several warehouses, check stock in the warehouse on the order, not the company total.

If you make to order or drop-ship, a stock block is usually wrong for those products. Our guide to Odoo inventory routes and rules, including MTO explains how those routes create supply from the sale itself.

How do you stop out-of-stock orders on the Odoo website?

Turn off "Continue Selling" for out-of-stock products in the eCommerce settings or on each product, and customers can no longer order what you do not have. This is the one place standard Odoo truly blocks.

Odoo's eCommerce documentation says to keep the Continue Selling option disabled to prevent customers from ordering products that are out of stock. On each product, the matching option is "Sell when Out-of-Stock".

Three related options help the customer side:

  • Show Available Qty: shows the remaining quantity below a threshold you set.
  • Out-of-Stock Message: custom text on the product page, such as the restock week.
  • Back in stock alert: shoppers can leave an email to be notified.

One trap: changing the default in settings does not update existing products. Odoo's docs state that the defaults only apply to products created afterwards, so fix existing products in bulk from the list view.

Odoo 20 adds a setting that goes further. Our Odoo 20 eCommerce release notes cover "Unpublish out-of-stock products", which hides a product when it runs out and publishes it again when stock returns. It only acts on tracked products that are not allowed to sell when out of stock.

How do you block archived or out-of-stock products with an automation rule?

An automation rule on the sales order, triggered when the state becomes Sales Order, can check each line and raise an error that cancels the confirmation. It needs no custom module and runs on Odoo Online, Odoo.sh and on-premise.

Odoo automation rules support a "State is set to" trigger and an "Execute Code" action. Inside that code, Odoo makes a UserError available, and raising it rolls back the save with a message the salesperson can read.

A typical setup looks like this:

  1. Model: Sales Order. Trigger: State is set to "Sales Order".
  2. Action: Execute Code that loops over the order lines and skips sections, notes and services.
  3. Archived check: if a line's product is not active, collect its name.
  4. Stock check: for tracked products, compare the line quantity with the product's free quantity in the order's warehouse.
  5. Result: if anything was collected, raise a UserError listing the products and the reason.
  6. Exceptions: let a "Stock Override" user group or an approved tag skip the check, so managers can still push urgent orders.

Add a second rule with the "On archived" trigger on products. It can schedule an activity on every open quotation holding the product, so reps fix quotes before customers accept them. Our Odoo automation rules guide walks through triggers and code actions in more depth.

Test rules like this on a staging copy first. Long B2B orders with hundreds of lines need the stock read in one batch, not line by line.

When do you need a custom module instead?

Move to a custom module when the rule must cover imports, integrations and portal orders, or when the logic is complex enough to need tests. Automation rules are fine for a clear, single check.

The common custom approach, also suggested on the Odoo forum for restricting confirmation by warehouse quantity, overrides the order's confirm method. Done well, it also checks order lines when they are created or written, so a connector cannot slip an archived product in.

Reasons to choose code over a rule:

  • Every entry point: website, portal, imports, the external API and connectors all pass the same check.
  • Replacement suggestions: the error can name the successor product and swap it on the line.
  • Automated tests: the check is covered by tests that run on every upgrade.

Custom modules need Odoo.sh or on-premise, because Odoo Online does not accept them. Both sit on the Custom plan, listed on Odoo pricing at US$61.00 per user a month billed yearly, against US$31.10 for Standard. See our Odoo Studio vs custom development comparison.

If large orders already go through managers, align this check with your sales order approval thresholds so the two do not fight. To size the work, use the free Odoo project estimate tool.

Which industries need hard sales blocks most?

Businesses with fast product turnover, regulated items or thin stock feel the cost of a wrong sale the most. The table shows where each one usually lands.

IndustryPain or cost driverOdoo approachHow iVentureTeam helps
Electronics distributionModels replaced every seasonUntick Sales, archive after stock clearsPhase-out rule with successor suggestion
Spare parts and industrialSuperseded part numbersWarning text plus confirm-time blockMap old to new parts, block old ones
Food and beverageSeasonal or short-life itemsFree quantity check by warehouseStock rule per warehouse and route
Apparel and fashionEnd-of-season variantsArchive variants, unpublish onlineBulk variant clean-up and Odoo 20 setting
B2B wholesaleLong repeat orders duplicatedArchived-line block on confirmRule plus open-quote alerts on archive
eCommerce retailOverselling on the websiteContinue Selling off, back in stock alertsSettings review and bulk product fix

How iVentureTeam helps prevent selling archived products in Odoo

Planning sales rules? Size the work first

iVentureTeam closes every path where an archived or out-of-stock product can reach a confirmed order, then keeps the fix working through upgrades. We have delivered 150+ ERP projects across 35+ countries with 40+ Odoo specialists, led by a consultant with 13+ years in Odoo.

  • Gap review: we list every channel that creates orders and test which ones let archived or short-stock products through.
  • Product clean-up: Sales checkboxes, variants, eCommerce stock options and Odoo 20 unpublish settings set in bulk.
  • Confirm-time check: an automation rule or a tested custom module, with a manager override and clear error messages.
  • Upgrade safety: we re-check old Blocking Message products after an 18 to 19 or 20 upgrade and replace them.
  • Ongoing care: our Odoo ERP support team adjusts rules as products, warehouses and channels change.

The bottom line on preventing sales of archived products in Odoo

Archiving and stock warnings in Odoo 19 and 20 inform salespeople, but they do not stop them; a confirm-time check is what makes the rule real. Use standard settings first and add one check on top.

Untick Sales during a phase-out, archive once stock is gone, turn off Continue Selling online, and add one rule that blocks archived or short-stock lines at confirmation. That combination stops nearly every wrong sale without blocking the orders you want.

Ready to stop the wrong products reaching confirmed orders?

Get a sales block review

Get a short review of where your Odoo lets discontinued or out-of-stock items through. Ask for an Odoo sales block review, call +91-90235-15208, or email business@iventureteam.com.

Frequently Asked Questions

How do I prevent selling archived products in Odoo?

+

Archiving hides the product from new order lines, but open and duplicated quotes keep it. Add an automation rule on the sales order that raises an error at confirmation if any line holds an archived product.

What happens to open quotations when I archive a product?

+

They keep the product. Odoo 19 and 20 show "This quote contains archived product(s)" on draft and sent quotes and mark the line, but the quote can still be confirmed.

Can Odoo block a sale when the product is out of stock?

+

Not in the Sales app by default. The availability icon turns red and the order can still be confirmed. On the website, turning off Continue Selling does block out-of-stock orders.

Where did the Blocking Message option go in Odoo 19?

+

Odoo 19 replaced the warning selector, which included Blocking Message, with a single Sales Order Line Warning text field. It shows a message only, so use an automation rule to block.

Should I archive a product or untick the Sales checkbox?

+

Untick Sales when you still buy, manufacture or count the product. Archive only when it is fully retired and its stock is zero, so no quantities end up hidden.

Does Odoo 20 hide out-of-stock products on the website?

+

Yes. Odoo 20 adds an Unpublish out-of-stock products setting that hides tracked products when they run out and publishes them again when stock returns.

Can I block out-of-stock sales on Odoo Online?

+

Yes, with an automation rule using Execute Code at confirmation, since rules run on Odoo Online. Custom modules are not accepted on Odoo Online, so deeper checks need Odoo.sh or on-premise.

Which stock quantity should the block check?

+

Free quantity, meaning on hand minus stock reserved for other deliveries, is usually right. Use forecasted quantity if you sell against incoming purchases, and check the order's warehouse.

Free written answer from a certified consultant

Getting stock under control in Odoo?

Tell us how stock moves through your business. We map warehouses, routes and replenishment in Odoo and show what to configure first.

Free, with no obligation. A senior consultant replies within 12 business hours.

We use cookies to improve your experience

Essential cookies make the site work, and we use analytics to improve it. Choose “Only necessary” to turn analytics off. See our cookie policy.