Repository
OCA/account-financial-tools · module folder · Try on Runboat
Module version
1.0.0
Category
Accounting & Finance
Folder size
0.78 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/account-financial-tools
Last tracking update
2026-08-07 08:42:53
Authors
Odoo Community Association (OCA), Onestein
Maintainers
Odoo Community Association (OCA), Onestein
Committers
Weblate, OCA-git-bot, oca-ci, Anusha
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
Allows to spread costs or revenues over a customizable periods, to even
out cost or invoice spikes.

Code Analysis

Views touched (8)
XML IDNameModelTypeStatus
view_account_spread account.spread form New
view_account_spread_invoice_line_link_wizard account.spread.invoice.line.link.wizard form New
view_account_spread_search account.spread search New
view_account_spread_template account.spread.template form New
view_account_spread_template_tree account.spread.template list New
view_account_spread_tree account.spread list New
view_company_form res.company form Inherits base.view_company_form
view_invoice_spread account.move form Inherits account.view_move_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (8)

New fields (0)

No new fields.

Public methods (2)
  • action_post(self)
    Invoked when validating the invoices.
  • button_cancel(self)
    Cancel the spread lines and their related moves when the invoice is canceled.

New fields (2)
  • spread_check Selection
    compute='_compute_spread_check' args: [('linked', 'Linked'), ('unlinked', 'Unlinked'), ('unavailable', 'Unavailable')]
  • spread_id Many2one → account.spread
    copy=False string='Spread Board' args: 'account.spread'
Public methods (3)
  • create_auto_spread(self)
    Create auto spread table for each invoice line, when needed
  • spread_details(self)
    Button on the invoice lines tree view of the invoice form to show the spread form view.
  • write(self, vals)

New fields (32)
  • active Boolean
    default=True
  • all_posted Boolean
    compute='_compute_all_posted' store=True
  • company_id Many2one → res.company
    default=<expr> required=True args: 'res.company'
  • credit_account_id Many2one → account.account
    compute='_compute_credit_account_id' readonly=False required=True store=True args: 'account.account'
  • currency_id Many2one → res.currency
    default=<expr> required=True args: 'res.currency'
  • days_calc Boolean
    default=False help='Use number of days to calculate amount' string='Calculate by days'
  • debit_account_id Many2one → account.account
    compute='_compute_debit_account_id' readonly=False required=True store=True args: 'account.account'
  • display_create_all_moves Boolean
    compute='_compute_display_create_all_moves'
  • display_move_line_auto_post Boolean
    compute='_compute_display_move_line_auto_post' string='Display Button Auto-post lines'
  • display_recompute_buttons Boolean
    compute='_compute_display_recompute_buttons'
  • estimated_amount Float
    digits='Account'
  • invoice_id Many2one
    related='invoice_line_id.move_id' store=True
  • invoice_line_id Many2one → account.move.line
    compute='_compute_invoice_line' inverse='_inverse_invoice_line' store=True string='Invoice line' args: 'account.move.line'
  • invoice_line_ids One2many → account.move.line
    copy=False string='Invoice Lines' args: 'account.move.line', 'spread_id'
  • invoice_type Selection
    required=True args: [('out_invoice', 'Customer Invoice'), ('in_invoice', 'Vendor Bill'), ('out_refund', 'Customer Credit Note'), ('in_refund', 'Vendor Credit Note')]
  • is_credit_account_deprecated Boolean
    compute='_compute_deprecated_accounts'
  • is_debit_account_deprecated Boolean
    compute='_compute_deprecated_accounts'
  • journal_id Many2one → account.journal
    check_company=True compute='_compute_journal_id' domain="[('id', 'in', suitable_journal_ids)]" precompute=True readonly=False required=True store=True args: 'account.journal'
  • line_ids One2many → account.spread.line
    string='Spread Lines' args: 'account.spread.line', 'spread_id'
  • move_line_auto_post Boolean
    default=True args: 'Auto-post lines'
  • name Char
    required=True
  • period_number Integer
    default=12 help='Define the number of spread lines' required=True string='Number of Repetitions'
  • period_type Selection
    default='month' help='Period length for the entries' required=True args: [('month', 'Month'), ('quarter', 'Quarter'), ('year', 'Year')]
  • posted_amount Float
    compute='_compute_amounts' digits='Account'
  • spread_date Date
    default=time.strftime('%Y-01-01') required=True string='Start Date'
  • spread_type Selection
    compute='_compute_spread_type' required=True args: [('sale', 'Customer'), ('purchase', 'Supplier')]
  • suitable_journal_ids Many2many → account.journal
    compute='_compute_suitable_journal_ids' args: 'account.journal'
  • template_id Many2one → account.spread.template
    string='Spread Template' args: 'account.spread.template'
  • total_amount Float
    compute='_compute_amounts' digits='Account'
  • unposted_amount Float
    compute='_compute_amounts' digits='Account'
  • unspread_amount Float
    compute='_compute_amounts' digits='Account'
  • use_invoice_line_account Boolean
Public methods (11)
  • action_recalculate_spread(self)
    Recalculate spread
  • action_undo_spread(self)
    Undo spreading: Remove all created moves
  • action_unlink_invoice_line(self)
    Unlink the invoice line from the spread board
  • compute_spread_board(self)
    Checks whether the spread lines should be calculated. In case checks pass, invoke "def _compute_spread_board()" method.
  • create_all_moves(self)
  • default_get(self, fields)
    @api.model
  • default_journal(self, company_id)
    @api.model
  • onchange_template(self)
    @api.onchange('template_id')
  • open_posted_view(self)
  • reconcile_spread_moves(self)
  • unlink(self)

New fields (13)
  • company_id Many2one → res.company
    required=True args: 'res.company'
  • exp_rev_account_id Many2one → account.account
    help='Optional account to overwrite the existing expense/revenue account' string='Expense/revenue account' args: 'account.account'
  • invoice_id Many2one
    related='invoice_line_id.move_id'
  • invoice_line_id Many2one → account.move.line
    ondelete='cascade' required=True args: 'account.move.line'
  • invoice_type Selection
    compute='_compute_invoice_type' store=True args: [('out_invoice', 'Customer Invoice'), ('in_invoice', 'Vendor Bill'), ('out_refund', 'Customer Credit Note'), ('in_refund', 'Vendor Credit Note')]
  • spread_account_id Many2one → account.account
    compute='_compute_spread_account' readonly=False store=True string='Balance sheet account / Spread account' args: 'account.account'
  • spread_action_type Selection
    default=<expr> selection=<expr>
  • spread_id Many2one → account.spread
    domain="[('id', 'in', spread_invoice_type_domain_ids)]" string='Spread Board' args: 'account.spread'
  • spread_invoice_type_domain_ids One2many → account.spread
    compute='_compute_spread_invoice_type_domain' args: 'account.spread'
  • spread_journal_id Many2one → account.journal
    compute='_compute_spread_journal' readonly=False store=True string='Spread Journal' args: 'account.journal'
  • spread_type Selection
    compute='_compute_invoice_type' store=True args: [('sale', 'Customer'), ('purchase', 'Supplier')]
  • template_id Many2one → account.spread.template
    string='Spread Template' args: 'account.spread.template'
  • use_invoice_line_account Boolean
    help="Use invoice line's account as Balance sheet / spread account.\nIn this case, user need to select expense/revenue account too."
Public methods (1)
  • confirm(self)

New fields (5)
  • amount Float
    digits='Account' required=True
  • date Date
    required=True
  • move_id Many2one → account.move
    string='Journal Entry' args: 'account.move'
  • name Char
    args: 'Description'
  • spread_id Many2one → account.spread
    ondelete='cascade' args: 'account.spread'
Public methods (4)
  • create_and_reconcile_moves(self)
  • create_move(self)
    Button to manually create a move from a spread line entry.
  • open_move(self)
    Used by a button to manually view a move from a spread line entry.
  • unlink_move(self)
    Used by a button to manually unlink a move from a spread line entry.

New fields (13)
  • auto_spread Boolean
    help='If checked, provide option to auto create spread during invoice validation, based on product/account/analytic in invoice line.' string='Auto assign template on invoice validate'
  • auto_spread_ids One2many → account.spread.template.auto
    comodel_name='account.spread.template.auto' inverse_name='template_id' string='Auto Spread On'
  • company_id Many2one → res.company
    default=<expr> required=True args: 'res.company'
  • days_calc Boolean
    default=False help='Use number of days to calculate amount' string='Calculate by days'
  • exp_rev_account_id Many2one → account.account
    help='Optional account to overwrite the existing expense/revenue account' string='Expense/Revenue Account' args: 'account.account'
  • name Char
    required=True
  • period_number Integer
    help='Define the number of spread lines' string='Number of Repetitions'
  • period_type Selection
    help='Period length for the entries' args: [('month', 'Month'), ('quarter', 'Quarter'), ('year', 'Year')]
  • spread_account_id Many2one → account.account
    compute='_compute_spread_account' readonly=False required=False store=True string='Spread Balance Sheet Account' args: 'account.account'
  • spread_journal_id Many2one → account.journal
    compute='_compute_spread_journal' readonly=False required=True store=True string='Journal' args: 'account.journal'
  • spread_type Selection
    default='sale' required=True args: [('sale', 'Customer'), ('purchase', 'Supplier')]
  • start_date Date
  • use_invoice_line_account Boolean
    help="Use invoice line's account as Balance sheet / spread account.\nIn this case, user need to select expense/revenue account too." string='Invoice account as spread account'
Public methods (1)
  • default_get(self, fields)
    @api.model

New fields (5)
  • account_id Many2one → account.account
    comodel_name='account.account' string='Account'
  • company_id Many2one
    related='template_id.company_id' store=True
  • name Char
    default='/' required=True
  • product_id Many2one → product.product
    comodel_name='product.product' string='Product'
  • template_id Many2one → account.spread.template
    comodel_name='account.spread.template' index=True ondelete='cascade' required=True string='Spread Template'
Public methods (0)

No public methods.

New fields (7)
  • allow_spread_planning Boolean
    default=True help='Disable this option if you do not want to allow the spreading before the invoice is validated.'
  • auto_archive_spread Boolean
    help='Enable this option if you want the cron job to automatically archive the spreads when all lines are posted.' args: 'Auto-archive spread'
  • default_spread_expense_account_id Many2one → account.account
    string='Expense Spread Account' args: 'account.account'
  • default_spread_expense_journal_id Many2one → account.journal
    string='Expense Spread Journal' args: 'account.journal'
  • default_spread_revenue_account_id Many2one → account.account
    string='Revenue Spread Account' args: 'account.account'
  • default_spread_revenue_journal_id Many2one → account.journal
    string='Revenue Spread Journal' args: 'account.journal'
  • force_move_auto_post Boolean
    help='Enable this option if you want to post automatically the accounting moves of all the spreads.' args: 'Auto-post spread lines'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…