OdooWiki OCA HUB

Sale Order Restrict Cancel Existing Invoice

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

This module restrict Sale Order cancellation if a confirmed invoice linked to that Sale exists.

auto_awesome What this module does

AI-generated from the code · Odoo 15.0

Prevents users from cancelling a sale order when a confirmed (posted) customer invoice is linked to it, showing a clear error message instead.

This module adds a safety rule to the Sales app: once a sale order has a confirmed invoice, you can no longer cancel that order.

  • A new technical field on the sale order collects all invoices linked to it that are in a confirmed state (posted).
  • When you try to cancel a sale order, Odoo checks this field. If any confirmed invoice exists, the cancellation is blocked and an error message appears: "You cannot cancel a Sale Order for which a confirmed invoice exists!"
  • The rule applies to the sale order screen and any other place where cancellation is triggered.
  • The module only touches the sale.order model and does not add new menus or screens.
  • It works automatically in the background; no configuration is needed.

Depends on

sale
Models and fields (1)
  • sale.order · extends an existing modelconfirmed_invoice_ids

Text generated by AI (DeepSeek) from reading the Odoo 15.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 15.0

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

terminal Installation and usage

OCA documentation · Odoo 15.0
  • Create a Sale Order and confirm it (and deliver products if needed)
  • Create Invoice and confirm it
  • On Sale Order, try to click on 'Cancel'. An error should occur

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.