Sale Stock Cancel Restriction
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.0Prevents 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.ordermodel 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
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-03Confirmation status: 5 confirmed, 4 with no information of 9 versions.
Sources · Odoo 16.0
Confirmed on 2026-11-03 in branch 16.0 of OCA/sale-workflow.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0To 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.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
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.