Sale Order Line Cancel

sale_order_line_cancel
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/18.0/sale_order_line_cancel
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp, ACSONE SA/NV, BCIM, Okia, MT Software
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp, ACSONE SA/NV, BCIM, Okia, MT Software
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, David Gallay
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:11
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - account_payment
    - account
    - onboarding
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows you to cancel the remaining quantity on sale order by
adding a dedicated action to sale lines. It also add two new fields to
track canceled and remaining to deliver quantities.

This module differs from the original odoo behavior in the following
way:

- In odoo, if the update of the quantity ordered is allowed on the sale
  order at the confirmed state, odoo will recompute the required stock
  operations according to the new quantity. This change is possible even
  the stock operations are started for this sale order line.
- In this module, you can either decide if only the canceled quantity
  gets tracked or if it also should decrease the original ordered
  quantity.

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
res_config_settings_form_view res.config.settings.form.view res.config.settings xpath Inherits sale.res_config_settings_view_form
sale_order_form_view sale.order xpath Inherits sale.view_order_form
sale_order_line_cancel_view_form sale.order.line.cancel form New
sale_order_line_tree_view sale.order.line xpath Inherits sale.view_order_line_tree
sale_order_line_view_form_readonly sale.order.line xpath Inherits sale.sale_order_line_view_form_readonly
Models touched (5)

New fields (1)
  • on_sale_line_cancel_decrease_line_qty Boolean
    help='On canceling the remaining qty to deliver of an order line it decreases the initial quantity' args: 'On sale order line cancel decrease line quantity'
Public methods (0)

No public methods.

New fields (1)
  • on_sale_line_cancel_decrease_line_qty Boolean
    readonly=False related='company_id.on_sale_line_cancel_decrease_line_qty'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (1)
  • action_draft(self)

New fields (3)
  • can_cancel_remaining_qty Boolean
    compute='_compute_can_cancel_remaining_qty'
  • product_qty_canceled Float
    copy=False digits='Product Unit of Measure' readonly=True args: 'Qty canceled'
  • product_qty_remains_to_deliver Float
    compute='_compute_product_qty_remains_to_deliver' digits='Product Unit of Measure' store=True string='Remains to deliver'
Public methods (1)
  • cancel_remaining_qty(self)

New fields (0)

No new fields.

Public methods (1)
  • cancel_remaining_qty(self)
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/17.0/sale_order_line_cancel
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp, ACSONE SA/NV, BCIM, Okia, MT Software
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp, ACSONE SA/NV, BCIM, Okia, MT Software
COMMITTERS
COMMITTERSOCA-git-bot, oca-ci, Paulius11
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:05
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - account_payment
    - account
    - onboarding
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows you to cancel the remaining quantity on sale order by
adding a dedicated action to sale lines. It also add two new fields to
track canceled and remaining to deliver quantities.

This module differs from the original odoo behavior in the following
way:

- In odoo, if the update of the quantity ordered is allowed on the sale
  order at the confirmed state, odoo will recompute the required stock
  operations according to the new quantity. This change is possible even
  the stock operations are started for this sale order line.
- In this module, you can either decide if only the canceled quantity
  gets tracked or if it also should decrease the original ordered
  quantity.

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
res_config_settings_form_view res.config.settings.form.view.sale.order.line.cancel res.config.settings xpath Inherits sale.res_config_settings_view_form
sale_order_form_view sale.order xpath Inherits sale.view_order_form
sale_order_line_cancel_view_form sale.order.line.cancel form New
sale_order_line_tree_view sale.order.line xpath Inherits sale.view_order_line_tree
Models touched (5)

New fields (1)
  • on_sale_line_cancel_decrease_line_qty Boolean
    help='On canceling the remaining qty to deliver of an order line it decreases the initial quantity' args: 'On sale order line cancel decrease line quantity'
Public methods (0)

No public methods.

New fields (1)
  • on_sale_line_cancel_decrease_line_qty Boolean
    readonly=False related='company_id.on_sale_line_cancel_decrease_line_qty' string='Decrease Line Quantity on Cancel'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (1)
  • action_draft(self)

New fields (3)
  • can_cancel_remaining_qty Boolean
    compute='_compute_can_cancel_remaining_qty'
  • product_qty_canceled Float
    copy=False digits='Product Unit of Measure' readonly=True args: 'Qty canceled'
  • product_qty_remains_to_deliver Float
    compute='_compute_product_qty_remains_to_deliver' digits='Product Unit of Measure' store=True string='Remains to deliver'
Public methods (1)
  • cancel_remaining_qty(self)

New fields (0)

No new fields.

Public methods (1)
  • cancel_remaining_qty(self)
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/16.0/sale_order_line_cancel
VERSION
VERSION 2.0.0
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp, ACSONE SA/NV, BCIM, Okia, MT Software
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp, ACSONE SA/NV, BCIM, Okia, MT Software
COMMITTERS
COMMITTERSGitHub, Laurent Mignon (ACSONE), Denis Roussel, sbejaoui, Weblate, OCA-git-bot, Michael Tietz, oca-ci, Denis Roussel (ACSONE)
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:45
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - account_payment
    - account
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
res_config_settings_form_view res.config.settings.form.view res.config.settings xpath Inherits sale.res_config_settings_view_form
sale_order_form_view sale.order xpath Inherits sale.view_order_form
sale_order_line_cancel_view_form sale.order.line.cancel form New
sale_order_line_tree_view sale.order.line xpath Inherits sale.view_order_line_tree
Models touched (5)

New fields (1)
  • on_sale_line_cancel_decrease_line_qty Boolean
    help='On canceling the remaining qty to deliver of an order line it decreases the initial quantity' args: 'On sale order line cancel decrease line quantity'
Public methods (0)

No public methods.

New fields (1)
  • on_sale_line_cancel_decrease_line_qty Boolean
    readonly=False related='company_id.on_sale_line_cancel_decrease_line_qty'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (1)
  • action_draft(self)

New fields (3)
  • can_cancel_remaining_qty Boolean
    compute='_compute_can_cancel_remaining_qty'
  • product_qty_canceled Float
    copy=False digits='Product Unit of Measure' readonly=True args: 'Qty canceled'
  • product_qty_remains_to_deliver Float
    compute='_compute_product_qty_remains_to_deliver' digits='Product Unit of Measure' store=True string='Remains to deliver'
Public methods (1)
  • cancel_remaining_qty(self)

New fields (0)

No new fields.

Public methods (1)
  • cancel_remaining_qty(self)