Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions contract_line_successor/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Contract Line Successor
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d0875078450d894287efb30f5acc2557d0290d7e2e1a1e3c17a2e54a281a79ae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/19.0/contract_line_successor
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-19-0/contract-19-0-contract_line_successor
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

| **Contract Line Successor** extends ``contract.line`` model to support
advanced contract lifecycle management, including suspension,
successor planning, cancellation, and renewal.
| It provides a flexible and robust framework for managing complex
contract line scenarios in a clean and structured way.

Features
--------

- **Successor and Predecessor Management**

- Link contract lines with successor and predecessor lines.
- Plan successors automatically or manually after a stop or
suspension.

- **Contract Line Lifecycle States**

- Manage contract lines with the following computed states:

- ``Upcoming``
- ``In-Progress``
- ``To Renew``
- ``Upcoming Close``
- ``Closed``
- ``Canceled``

- **Lifecycle Operations**

- Stop a contract line.
- Plan a successor for a contract line.
- Stop and plan a successor in one operation (useful for
suspensions).
- Cancel and un-cancel contract lines.
- Renew contract lines automatically (new line or extension).

- **Auto-Renewal Handling**

- Auto-renewal based on company settings (extend existing line or
create a new one).
- Cron job to automate renewal of eligible contract lines.

- **Data Integrity and Validation**

- Prevent invalid successor or predecessor configurations.
- Validate state transitions and date overlaps.
- Ensure clean renewal and cancellation workflows.

- **Audit Trail**

- Automatic posting of chatter messages for lifecycle events like
stops, renewals, suspensions, cancellations, etc.

**Table of contents**

.. contents::
:local:

Configuration
=============

- | **Auto-Renewal Strategy**
| In the company settings, define whether renewing a contract line:

- Extends the current line (updates ``date_end``),
- or creates a new successor contract line.

| Field:
| ``Company > Configuration > Contracts > Create new contract line at renewal``

- | **Scheduled Actions**
| Ensure the scheduled action ``Contract Line: Auto Renew`` is
activated if you want automatic renewal without manual
intervention.

Usage
=====

1. **Select a contract** and enable the option **"Recurrence at line
level?"**.
2. Once enabled, you will have access to several actions at the contract
line level:

- **Stop** a contract line and optionally **plan a successor**.
- **Handle temporary suspensions** and **resume** the contract line
after the suspension period.
- **Cancel** and **un-cancel** contract lines if necessary.
- **Renew** contract lines either by **extending** the current line
or by **creating a new successor line** automatically.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_line_successor%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Souheil Bejaoui souheil.bejaoui@acsone.eu (ACSONE SA/NV)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
:target: https://github.com/sbejaoui
:alt: sbejaoui

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbejaoui|

This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/19.0/contract_line_successor>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions contract_line_successor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
24 changes: 24 additions & 0 deletions contract_line_successor/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Contract Line Successor",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/contract",
"depends": ["contract"],
"development_status": "Production/Stable",
"maintainers": ["sbejaoui"],
"data": [
"data/contract_renew_cron.xml",
"security/ir.model.access.csv",
"views/contract_template.xml",
"views/contract_contract.xml",
"views/contract_template_line.xml",
"views/contract_line.xml",
"wizards/contract_line_wizard.xml",
"views/res_config_settings.xml",
],
"demo": [],
}
12 changes: 12 additions & 0 deletions contract_line_successor/data/contract_renew_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record model="ir.cron" id="contract_line_cron_for_renew">
<field name="name">Renew Contract lines</field>
<field name="model_id" ref="model_contract_line" />
<field name="state">code</field>
<field name="code">model.cron_renew_contract_line()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
</record>
</odoo>
Loading
Loading