Contract Refund On Stop

contract_refund_on_stop
REPOSITORY
REPOSITORYOCA/contract
GIT
GIThttps://github.com/OCA/contract.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/contract/tree/18.0/contract_refund_on_stop
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYUncategorized
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), ACSONE SA/NV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), ACSONE SA/NV
COMMITTERS
COMMITTERSsbejaoui, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/contract
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:10
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/contract:
    - contract_line_successor
    - contract
    - contract_variable_qty_prorated
    - contract_variable_quantity
odoo/odoo:
    - base
    - account
    - base_setup
    - web
    - onboarding
    - product
    - mail
    - bus
    - web_tour
    - html_editor
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows stopping a contract line even after it has been invoiced.

When the stop date is earlier than the last invoiced date, the system will:

- Automatically create a refund invoice for the period between the stop date and the last invoiced date.
- Adjust the `last_date_invoiced` of the contract line to match the stop date.
- Proceed with the normal stop process.

To accurately compute the refund amount, the module depends on
**`contract_variable_qty_prorated`**, which provides the prorating logic used to
determine how much of the previously invoiced quantity should be refunded based
on the actual number of days covered by the refund period.

Without this dependency, it would not be possible to proportionally calculate
the part of the invoiced quantity corresponding to unused service time when a
contract is stopped mid-period.

This ensures that users can gracefully handle early contract terminations
without manual refund management, while maintaining accurate prorated invoicing
and accounting consistency.

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
res_config_settings_form_view res.config.settings xpath Inherits contract.res_config_settings_form_view
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • stop(self, date_end, manual_renew_needed=False, post_message=True)

New fields (1)
  • enable_contract_line_refund_on_stop Boolean
    help='If enabled, users can stop a contract line even after it has been invoiced. A refund will automatically be created for the invoiced period beyond the stop date.'
Public methods (0)

No public methods.

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

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/contract
PULL REQUEST
PULL REQUEST[19.0][MIG] contract_refund_on_stop (#1369)