OdooWiki OCA HUB

Sale Order Line Cancel Sale Stock

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

This module cancels only the stock moves for the remaining qty to deliver. Also it will track the canceled qty if a order line's stock move is canceled but only if there are not other started operations for this sale order line.

When the base addon is configured to also decrease the original ordered qty it ensures that there are now new moves created. Because by default, odoo will recompute the required stock operations if the ordered qty is changed. By canceling the operations for the remaining qty before the ordered qty is changed, odoo will not recompute the required stock operations, because the qty done by moves is the same as the ordered qty.

> [!WARNING] > It's not recommended to use this module if the update of the quantity > ordered on the sale order line is allowed the confirmed state. This > could lead to unpredictable behavior.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Cancel only the remaining stock to deliver on a sale order line, without touching quantities already delivered. The cancelled quantity is tracked on the sale order line.

This module extends the sale order line cancellation feature so that stock operations are handled correctly. When you cancel the remaining quantity on a confirmed sale order line, it first cancels the pending outgoing stock moves for that line, then updates the cancelled quantity on the line.

  • It only cancels stock moves that are not yet done or cancelled, and only for lines whose delivered quantity is based on stock moves and that can have their remaining quantity cancelled.
  • It prevents Odoo from recreating stock moves when the ordered quantity is reduced, because the moves are cancelled before the quantity change.
  • It also tracks the cancelled quantity when a stock move is cancelled manually, but only if there are no other pending moves for that sale order line.
  • When a backorder is cancelled during validation, the cancelled quantity on the sale order line is updated.

The module touches sale.order, sale.order.line and stock.move. It adds no new menus or screens; the behaviour is integrated into the existing cancel remaining quantity action on sale order lines and into stock move cancellation and validation flows.

Note: the code warns that using this module together with allowing ordered quantity changes on confirmed sale orders may lead to unpredictable results.

Depends on

Required by other modules

Models and fields (3)
  • sale.order · extends an existing model
  • stock.move · extends an existing model
  • sale.order.line · 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: 2 confirmed, 7 with no information of 9 versions.

Sources · Odoo 18.0

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

terminal Installation and usage

No verified information

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.

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.