Contract Refund On Stop
contract_refund_on_stop · OCA/contract
-
Security25/25No findings
-
Activity25/25Last human commit 3 months ago
-
Required by5/250 modules depend on it
-
Maturity12/25In 2 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
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_invoicedof 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.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 1
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
res_config_settings_form_view |
res.config.settings | form | Inherits contract.res_config_settings_form_view |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 3
No new fields.
Public methods (1)-
stop(self, date_end, manual_renew_needed=False, post_message=True)
-
enable_contract_line_refund_on_stopBooleanhelp='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.'
No public methods.
-
enable_contract_line_refund_on_stopBooleanreadonly=Falserelated='company_id.enable_contract_line_refund_on_stop'
No public methods.
Loading…