OdooWiki OCA HUB

Sale Cancel Restrict

sale_cancel_restrict folder_open OCA/sale-workflow open_in_new
Sale License: AGPL-3

When you try to cancel a sales order, if there is some delivery done or an invoice not cancelled will prevent the sales order from being cancelled.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Adds an option in Sales settings that blocks cancelling a sales order when a delivery has already been completed or when invoices are still draft or posted.

This module gives you a safety switch for cancelling sales orders. Once the option is turned on, Odoo will refuse to cancel a sales order in two situations: when at least one of its deliveries is already marked as done, or when it still has invoices that are not cancelled (draft or posted).

Where to find it: - Go to the Sales settings screen; a new checkbox appears in the sales management section, with a help text explaining the rule. - The setting is stored per company, so each company can decide independently whether the restriction applies.

What changes for users: - Trying to cancel a blocked sales order shows a clear error message naming the order, telling you it has completed transfers or that you must cancel the invoices first. - The check runs automatically every time a cancellation is attempted on a sales order. - The restriction only applies when the company option is enabled; if it is off, cancellation behaves as usual.

The module extends the sales order, company and settings models, and depends on sale_stock so it can look at the deliveries linked to the order. It does not add new menus or reports; it only adds the setting and the cancellation check.

Depends on

sale_stock
Models and fields (3)
  • sale.order · extends an existing model
  • res.company · extends an existing modelenable_sale_cancel_restrict
  • res.config.settings · extends an existing modelenable_sale_cancel_restrict

Text generated by AI (DeepSeek) from reading the Odoo 19.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: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 19.0

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

terminal Installation and usage

OCA documentation · Odoo 19.0

To use this module, you need to:

  • Enable Sale Cancel Confirmed Invoice at Sales -\> Settings -\> Enable Sale Cancel Restrict.
  • Click at "Cancel Order" button from a sales order which state equal to Sales Order
  • It will show an alert that prevents the sale order from being cancelled.

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.