Repository
OCA/contract · module folder · Try on Runboat
Module version
1.1.3
Category
Subscription Management
Folder size
0.8 MB
License
AGPL-3
Application
Yes
Auto-installable
No
Website
https://github.com/OCA/contract
Last tracking update
2026-08-07 09:06:34
Authors
Odoo Community Association (OCA), Onestein, Domatix
Maintainers
Odoo Community Association (OCA), Onestein, Domatix
Committers
Weblate, OCA-git-bot, oca-ci, stferraro, alvaro-domatix
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
This module allows creating subscriptions that generate recurring
invoices or orders. It also enables the sale of products that generate
subscriptions.

Code Analysis

Views touched (16)
XML IDNameModelTypeStatus
close_reason_wizard_view close.reason.wizard.view close.reason.wizard form New
product_template_form_view product.template.sub.form product.template form Inherits product.product_template_form_view
res_partner_view_form res.partner.form res.partner form Inherits base.view_partner_form
sale_subscription_form sale.subscription.form sale.subscription form New
sale_subscription_kanban sale.subscription.kanban sale.subscription kanban New
sale_subscription_template_form sale.subscription.template.form sale.subscription.template form New
sale_subscription_template_tree sale.subscription.template.list sale.subscription.template list New
sale_subscription_tree sale.subscription.list sale.subscription list New
view_move_form account.move form Inherits account.view_move_form
view_product_suscribable_filter product.suscribable.filter product.template search New
view_sale_order_form view.sale_order.form sale.order form Inherits sale.view_order_form
view_sale_order_pending_filter sale.order.pending.filter sale.subscription search New
view_sale_subscription_tag_tree view.sale.subscription.tag.list sale.subscription.tag list New
view_subscription_close_reason_tree view.subscription.close.reason.list sale.subscription.close.reason list New
view_subscription_stage_form view.subscription.stage.form sale.subscription.stage form New
view_subscription_stage_tree view.subscription.stage.list sale.subscription.stage list New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (12)

New fields (1)
  • subscription_id Many2one → sale.subscription
    comodel_name='sale.subscription' string='Subscription'
Public methods (1)
  • action_open_subscription(self)

New fields (1)
  • close_reason_id Many2one → sale.subscription.close.reason
    comodel_name='sale.subscription.close.reason' string='Reason'
Public methods (1)
  • button_confirm(self)

New fields (2)
  • subscribable Boolean
    string='Subscribable product'
  • subscription_template_id Many2one → sale.subscription.template
    comodel_name='sale.subscription.template' string='Subscription template'
Public methods (0)

No public methods.

New fields (2)
  • subscription_count Integer
    compute='_compute_subscription_count' required=False
  • subscription_ids One2many → sale.subscription
    comodel_name='sale.subscription' inverse_name='partner_id' string='Subscriptions'
Public methods (1)
  • action_view_subscription_ids(self)

New fields (3)
  • order_subscription_id Many2one → sale.subscription
    comodel_name='sale.subscription' string='Subscription'
  • subscription_ids One2many → sale.subscription
    comodel_name='sale.subscription' inverse_name='sale_order_id' string='Subscriptions'
  • subscriptions_count Integer
    compute='_compute_subscriptions_count'
Public methods (5)
  • action_confirm(self)
    Create a subscription per template from the Order's products
  • action_view_subscriptions(self)
  • create_subscription(self, lines, subscription_tmpl)
  • get_next_interval(self, type_interval, interval)
  • group_subscription_lines(self)
    Group Sale Order Lines by their product's subscription template

New fields (0)

No new fields.

Public methods (1)
  • get_subscription_line_values(self)

New fields (38)
  • account_invoice_ids_count Integer
    compute='_compute_account_invoice_ids_count' string='Invoice Count'
  • active Boolean
    default=True
  • amount_tax Monetary
    compute='_compute_total' store=True
  • amount_total Monetary
    compute='_compute_total' store=True
  • close_reason_id Many2one → sale.subscription.close.reason
    comodel_name='sale.subscription.close.reason' string='Close Reason'
  • code Char
    default=<expr> string='Reference'
  • color Integer
    args: 'Color Index'
  • company_id Many2one → res.company
    default=<expr> index=True required=True args: 'res.company', 'Company'
  • crm_team_id Many2one → crm.team
    comodel_name='crm.team' string='Sale team'
  • currency_id Many2one
    depends=['pricelist_id'] ondelete='restrict' related='pricelist_id.currency_id' store=True
  • date Date
    compute='_compute_rule_boundary' readonly=False store=True string='Finish date'
  • date_start Date
    default=date.today() string='Start date'
  • description Text
  • fiscal_position_id Many2one → account.fiscal.position
    check_company=True domain="[('company_id', '=', company_id)]" string='Fiscal Position' args: 'account.fiscal.position'
  • image Binary
    related='user_id.image_512' store=True args: 'Image'
  • in_progress Boolean
    default=False string='In progress'
  • invoice_ids One2many → account.move
    comodel_name='account.move' inverse_name='subscription_id' string='Invoices'
  • journal_id Many2one → account.journal
    comodel_name='account.journal' string='Journal'
  • name Char
    compute='_compute_name' store=True
  • partner_id Many2one → res.partner
    comodel_name='res.partner' index=True required=True string='Partner'
  • partner_invoice_id Many2one → res.partner
    comodel_name='res.partner' compute='_compute_partner_address_ids' help="Address the recurring invoices are addressed to. Defaults to the customer's invoice address." readonly=False store=True string='Invoice address'
  • partner_shipping_id Many2one → res.partner
    comodel_name='res.partner' compute='_compute_partner_address_ids' help="Delivery address used on the recurring invoices and orders. Defaults to the customer's delivery address." readonly=False store=True string='Delivery address'
  • pricelist_id Many2one → product.pricelist
    comodel_name='product.pricelist' required=True string='Pricelist'
  • recurring_next_date Date
    default=date.today() string='Next invoice date'
  • recurring_rule_boundary Boolean
    compute='_compute_rule_boundary' store=True string='Boundary'
  • recurring_total Monetary
    compute='_compute_total' store=True string='Recurring price'
  • sale_order_id Many2one → sale.order
    comodel_name='sale.order' string='Origin sale order'
  • sale_order_ids One2many → sale.order
    comodel_name='sale.order' inverse_name='order_subscription_id' string='Orders'
  • sale_order_ids_count Integer
    compute='_compute_sale_order_ids_count' string='Sale orders'
  • sale_subscription_line_ids One2many → sale.subscription.line
    comodel_name='sale.subscription.line' inverse_name='sale_subscription_id'
  • sequence Integer
  • stage_id Many2one → sale.subscription.stage
    comodel_name='sale.subscription.stage' group_expand='_read_group_stage_ids' store=True string='Stage' tracking=True
  • stage_type Selection
    related='stage_id.type'
  • tag_ids Many2many → sale.subscription.tag
    comodel_name='sale.subscription.tag' string='Tags'
  • template_id Many2one → sale.subscription.template
    comodel_name='sale.subscription.template' required=True string='Subscription template'
  • terms Text
    compute='_compute_terms' readonly=False store=True string='Terms and conditions'
  • to_renew Boolean
    default=False string='To renew'
  • user_id Many2one → res.users
    comodel_name='res.users' default=<expr> string='Commercial agent'
Public methods (15)
  • action_close_subscription(self)
  • action_start_subscription(self)
  • action_view_account_invoice_ids(self)
  • action_view_sale_order_ids(self)
  • calculate_recurring_next_date(self, start_date)
  • close_subscription(self, close_reason_id=False)
  • create(self, vals_list)
    @api.model_create_multi
  • create_invoice(self)
  • create_sale_order(self)
  • cron_subscription_management(self)
    @api.model
  • generate_invoice(self)
  • manual_invoice(self)
  • onchange_partner_id(self)
    @api.onchange('partner_id')
  • onchange_partner_id_fpos(self)
    @api.onchange('partner_id', 'company_id')
  • write(self, values)

New fields (1)
  • name Char
    required=True
Public methods (0)

No public methods.

New fields (12)
  • amount_tax_line_amount Float
    compute='_compute_subtotal' store=True string='Taxes Amount'
  • company_id Many2one
    index=True related='sale_subscription_id.company_id' store=True string='Company'
  • currency_id Many2one → res.currency
    readonly=True related='sale_subscription_id.currency_id' store=True args: 'res.currency'
  • discount Float
    compute='_compute_discount' readonly=False store=True string='Discount (%)'
  • name Char
    compute='_compute_name' readonly=False store=True string='Description'
  • price_subtotal Monetary
    compute='_compute_subtotal' readonly=True store=True string='Subtotal'
  • price_total Monetary
    compute='_compute_subtotal' readonly=True store=True string='Total'
  • price_unit Float
    compute='_compute_price_unit' readonly=False store=True string='Unit price'
  • product_id Many2one → product.product
    comodel_name='product.product' domain=[('sale_ok', '=', True)] string='Product'
  • product_uom_qty Float
    default=1.0 string='Quantity'
  • sale_subscription_id Many2one → sale.subscription
    comodel_name='sale.subscription' string='Subscription'
  • tax_ids Many2many → account.tax
    column1='subscription_line_id' column2='tax_id' comodel_name='account.tax' compute='_compute_tax_ids' readonly=False relation='subscription_line_tax' store=True string='Taxes'
Public methods (0)

No public methods.

New fields (6)
  • description Text
    translate=True
  • fold Boolean
    string='Kanban folded'
  • in_progress Boolean
    default=False string='In progress'
  • name Char
    required=True translate=True
  • sequence Integer
  • type Selection
    default='pre' args: [('draft', 'Draft'), ('pre', 'Ready to start'), ('in_progress', 'In progress'), ('post', 'Closed')]
Public methods (0)

No public methods.

New fields (1)
  • name Char
    required=True args: 'Tag name'
Public methods (0)

No public methods.

New fields (13)
  • code Char
  • description Text
    string='Terms and conditions'
  • invoice_mail_template_id Many2one → mail.template
    comodel_name='mail.template' domain="[('model', '=', 'account.move')]" string='Invoice Email'
  • invoicing_mode Selection
    default='draft' selection=[('draft', 'Draft'), ('invoice', 'Invoice'), ('invoice_send', 'Invoice & send'), ('sale_and_invoice', 'Sale order & Invoice')] string='Invoicing mode'
  • name Char
    required=True
  • product_ids One2many → product.template
    comodel_name='product.template' inverse_name='subscription_template_id' string='Products'
  • product_ids_count Integer
    compute='_compute_product_ids_count' string='product_ids'
  • recurring_interval Integer
    default=1 string='Repeat every'
  • recurring_rule_boundary Selection
    default='unlimited' string='Duration' args: [('unlimited', 'Forever'), ('limited', 'Fixed')]
  • recurring_rule_count Integer
    default=1 string='Rule count'
  • recurring_rule_type Selection
    default='months' string='Recurrence' args: [('days', 'Day(s)'), ('weeks', 'Week(s)'), ('months', 'Month(s)'), ('years', 'Year(s)')]
  • subscription_count Integer
    compute='_compute_subscription_count' string='subscription_ids'
  • subscription_ids One2many → sale.subscription
    comodel_name='sale.subscription' inverse_name='template_id' string='Subscriptions'
Public methods (2)
  • action_view_product_ids(self)
  • action_view_subscription_ids(self)

Loading…

Loading…

Loading…

Loading…

Loading…