OdooWiki OCA HUB

Base Cancel Confirm

base_cancel_confirm folder_open OCA/server-ux open_in_new
Usability License: AGPL-3

Many document model that already has cancel action may also want a confirm dialog with option to provide reason.

This module does not provide a functionality by itself but an abstract model to easily implement a confirm with reason wizard when cancel button is clicked. If reason is provided, it will be visible in form view.

Note: To be able to use this module in a new model you will need some development.

You can see implementation example as followings,

  • sale_cancel_confirm
  • purchase_cancel_confirm
  • purchase_request_cancel_confirm
  • account_move_cancel_confirm

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Provides a reusable cancel-confirmation wizard that asks users to confirm a cancellation and optionally record a reason, who cancelled and when. It is a technical building block: other modules must be adapted to use it.

This module does not add a menu or a screen by itself. It supplies a shared confirmation dialog that other modules can plug into their own cancel buttons, so users see a pop-up asking "Are you sure to cancel this document?" before the cancellation is applied.

In that dialog the user can type a cancellation reason. Depending on how the calling module is configured, the reason can be hidden, optional or mandatory. When the user presses Confirm, the document is flagged as cancelled, and the reason, the user who cancelled and the cancellation date are saved on it. If the user presses Cancel, nothing happens.

  • A small block showing the cancellation reason, who cancelled and when can be inserted into the form of any document that uses this module.
  • A helper is available to clear that cancellation information again, for example when a document is reset to draft.
  • A system setting can switch the confirmation flag on or off for each document type; if the setting contains anything other than True or False, an error is raised.

Technically it defines an abstract model base.cancel.confirm that other models inherit, plus a wizard model cancel.confirm with the confirmation screen and its action. Access to the wizard is granted to all internal users. The actual cancel buttons still have to be wired up by a developer in each document module.

Depends on

base
Models and fields (2)
  • cancel.confirm · new modelcancel_reason, has_cancel_reason
  • base.cancel.confirm · new modelcancel_by, cancel_date, cancel_reason, cancel_confirm (Cancel Confirmed)

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: 6 confirmed, 3 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/server-ux.

terminal Installation and usage

OCA documentation · Odoo 19.0

By default, the cancel confirm will be disabled (to ensure no side effect on other module unit test)

To enable cancel confirm wizard, please add System Parameter (ir.config_parameter) for each extended module.

For example,

  • sale_cancel_confirm, add sale.order.cancel_confirm_disable = False
  • purchase_cancel_confirm, add purchase.order.cancel_confirm_disable = False

No verified information in OCA: Installation, Usage.

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.