OdooWiki OCA HUB

Stock archive constraint

stock_archive_constraint folder_open OCA/stock-logistics-warehouse open_in_new
Warehouse License: AGPL-3

Prevents archiving products or storage locations that have existing inventory or related transactions.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Stops users from archiving products or storage locations that still have stock on hand or unfinished stock operations, showing a clear error message instead.

This module adds safety checks to the standard archiving action (the "Archive" toggle) in Odoo's Inventory app. It does not add new menus or screens; it simply blocks archiving when it would be unsafe.

For products, archiving is refused when: - The product still has a non-zero quantity in internal or transit locations (stock on hand). - The product appears on stock moves that are not yet done or cancelled (open transfers). - The product appears on stock move lines that are not yet done or cancelled (open reservations).

For storage locations, archiving is refused when the location (or any of its child locations) is used as source or destination on stock moves or stock move lines that are not yet done or cancelled.

When a check fails, Odoo raises a validation error naming the product or location, so the user knows exactly why archiving was blocked. The checks run automatically whenever the active flag is changed on product.product or stock.location. No new fields, reports, emails or scheduled jobs are added.

Depends on

stock
Models and fields (2)
  • stock.location · extends an existing model
  • product.product · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 6 confirmed, 3 with no information of 9 versions.

Sources · Odoo 12.0

Confirmed on 2026-11-03 in branch 12.0 of OCA/stock-logistics-warehouse.

terminal Installation and usage

OCA documentation · Odoo 18.0
  • Go to Settings \> Users \> Edit a user and check the "Manage Multiple Stock Locations" permission
  • Go to Inventory \> Configuration \> Configuration \> Settings, in the Warehouse section and check the "Storage Locations" option
  • Go to Inventory \> Configuration \> Locations and attempt to archive a location that has an associated stock move, either as the source or destination.
  • Go to inventory \> Products \> Products and try to archive a product associated with the stock selection, which is in stock, or which has some movement assigned to it

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.