OdooWiki OCA HUB

Sale Stock Cancel Restriction

sale_stock_cancel_restriction folder_open OCA/sale-workflow open_in_new
Sales Management License: AGPL-3

This module extends the functionality of Sales to avoid canceling sales orders with 'Done' pickings.

Derived from:

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Prevents cancelling sales orders that already have completed stock deliveries, by raising the standard Odoo error when a user tries to cancel such an order.

This module adds a safety rule to sales orders that are linked to stock transfers (pickings). When a user clicks the cancel action on a sales order, the module first looks at all the stock transfers connected to that order and checks whether any of them are already in the 'Done' state, meaning the goods were actually shipped or received.

If a completed transfer exists, the module forces the normal cancellation routine on that transfer so Odoo raises its usual error and the sales order cannot be cancelled. This closes a gap in standard Odoo, where completed transfers are filtered out of the cancellation process and the order could otherwise be cancelled even though the stock movement already happened.

  • Applies to the sales order screen and its cancel button/action.
  • Touches the sale.order model and its related stock transfers (picking_ids).
  • No new fields, menus, reports or scheduled jobs are added.
  • No configuration is required; the restriction is active as soon as the module is installed.

The result is that once a delivery is done, the related sales order stays protected from cancellation, helping keep sales and stock records consistent.

Depends on

sale_stock
Models and fields (1)
  • sale.order · 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: 5 confirmed, 4 with no information of 9 versions.

Sources · Odoo 17.0

Confirmed on 2026-11-03 in branch 17.0 of OCA/sale-workflow.

terminal Installation and usage

OCA documentation · Odoo 18.0

To use this module, you need to:

  • Go to Sales -\> Orders -\> Quotations and create a new quotation.
  • Add some storable products and confirm the quotation.
  • Go to the related pickings and confirm them.
  • Go back to the quotation, try to cancel it and you will get a validation message that will not let you cancel the order.

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.