Repository
OCA/contract · module folder · Try on Runboat
Module version
1.0.1
Category
Uncategorized
Folder size
0.13 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/contract
Last tracking update
2026-08-07 08:43:01
Authors
ACSONE SA/NV, Odoo Community Association (OCA)
Maintainers
ACSONE SA/NV, Odoo Community Association (OCA)
Committers
sbejaoui, Weblate, OCA-git-bot, oca-ci, hda
Odoo dependencies
Python dependencies
requests
System dependencies
None
Required by
contract_forecast_brand, contract_forecast_variable_quantity
Description
The contract_forecast module enhances the **Contract** module by
generating and managing **forecast periods** for each contract line. It
automatically calculates future invoicing amounts and dates, allowing
companies to better anticipate and report on expected revenues.

Forecasts are visible directly from the contract in a **pivot view** or
**list view**.

\## Features

- Generate forecast periods based on the contract's invoicing rules.
- View forecasts grouped by invoice date.
- Automatic regeneration of forecast periods when contract data changes
  (product, quantity, price, dates, etc.).
- Company-wide configuration to enable or disable forecasts.
- Configurable forecast interval and period type (monthly or yearly).
- Forecast period data includes:
  - Start and end dates
  - Expected invoice date
  - Quantity, unit price, discount, and subtotal (untaxed)
- Clean handling of auto-renewing and manually-ended contracts.

Code Analysis

Views touched (6)
XML IDNameModelTypeStatus
contract_contract_form_view contract.contract form Inherits contract.contract_contract_form_view
contract_line_forecast_period_graph_view contract.line.forecast.period.graph (in contract_forecast) contract.line.forecast.period graph New
contract_line_forecast_period_pivot_view contract.line.forecast.period.pivot (in contract_forecast) contract.line.forecast.period pivot New
contract_line_forecast_period_search_view contract.line.forecast.period search New
contract_line_forecast_period_tree_view contract.line.forecast.period list New
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 (5)

New fields (0)

No new fields.

Public methods (2)
  • action_show_contract_forecast(self)
  • write(self, values)

New fields (1)
  • forecast_period_ids One2many → contract.line.forecast.period
    comodel_name='contract.line.forecast.period' inverse_name='contract_line_id' required=False string='Forecast Periods'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, values)

New fields (14)
  • company_id Many2one → res.company
    comodel_name='res.company' string='Company'
  • contract_id Many2one → contract.contract
    comodel_name='contract.contract' index=True ondelete='cascade' readonly=True related='contract_line_id.contract_id' required=True store=True
  • contract_line_id Many2one → contract.line
    comodel_name='contract.line' index=True ondelete='cascade' readonly=True required=True
  • currency_id Many2one
    related='contract_id.currency_id' store=True
  • date_end Date
    readonly=True required=True
  • date_invoice Date
    readonly=True required=True string='Invoice Date'
  • date_start Date
    readonly=True required=True
  • discount Float
    digits='Discount' help='Discount that is applied in generated invoices. It should be less or equal to 100' string='Discount (%)'
  • name Char
    readonly=True required=True
  • price_subtotal Monetary
    compute='_compute_price_subtotal' store=True string='Amount Untaxed'
  • price_unit Monetary
    string='Unit Price'
  • product_id Many2one → product.product
    comodel_name='product.product' index=True readonly=True related='contract_line_id.product_id' required=True store=True
  • quantity Float
    default=1.0 required=True
  • sequence Integer
    related='contract_line_id.sequence' store=True
Public methods (0)

No public methods.

New fields (3)
  • contract_forecast_interval Integer
    default=12 string='Number of contract forecast Periods'
  • contract_forecast_rule_type Selection
    default='monthly' args: [('monthly', 'Month(s)'), ('yearly', 'Year(s)')]
  • enable_contract_forecast Boolean
    default=True string='Enable contract forecast'
Public methods (0)

No public methods.

New fields (3)
  • contract_forecast_interval Integer
    readonly=False related='company_id.contract_forecast_interval'
  • contract_forecast_rule_type Selection
    readonly=False related='company_id.contract_forecast_rule_type'
  • enable_contract_forecast Boolean
    readonly=False related='company_id.enable_contract_forecast'
Public methods (0)

No public methods.

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
checks failing
Open since
66 days ago
Last activity
66 days ago
Repository
OCA/contract
Pull request
[19.0][MIG] contract_forecast (#1464)