Skip to content
Health
54/100
fair
  • Security25/25
    No findings
  • Activity12/25
    Last human commit 20 months ago
  • Required by5/25
    0 modules depend on it
  • Maturity12/25
    In 2 Odoo series since 14.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.21 MB
Module directory on disk
Code analysis 0 migration notes 6 models 6 views 0 HTTP endpoints

Description

This module allows to generate cu-toff entries automatically when posting former entries.

This module is based on account_invoice_start_end_dates which allows to define start end end dates on invoice line (account.move.line).

Following assumption have been made before developing this module:

- New method to compute cutoff amounts can be add by business modules

[!NOTE] This module as been developed with some opinionated design do not depends on account_cutoff_base. Because:

- we don't want rely on user nor async task at the end of
  each month (period)
- link entries to understand the history without merging amounts
  in order to be able to keep details on deferred account
  move line (analytics, partners, accounts and so on)

Dependencies

Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 6

XML IDNameModelTypeStatus
res_config_settings_view_form cutoff.res.config.settings.form res.config.settings form Inherits account.res_config_settings_view_form
view_account_form account.account.form account.account form Inherits account.view_account_form
view_account_list account.account.list account.account list Inherits account.view_account_list
view_move_form account.move.form account.move form Inherits account.view_move_form
view_move_line_form account.move.line.form account.move.line form Inherits account.view_move_line_form
view_move_line_tree account.move.line.tree account.move.line tree Inherits account.view_move_line_tree

HTTP endpoints 0

No HTTP endpoints found for this module.

Models touched 6

New fields (1)
  • deferred_accrual_account_id Many2one → account.account
    comodel_name='account.account' domain="[('company_id', '=', company_id),('account_type', 'in', ('asset_current', 'liability_current')),]" help="Account used to deferred Revenues/Expenses in next periods. If not set revenue won't be deferred" string='Revenue/Expense accrual account'
Public methods (0)

No public methods.

New fields (3)
  • cutoff_entry_ids One2many → account.move
    comodel_name='account.move' help='Field use to make easy to user to follow entries generated from this specific entry to deferred revenues or expenses.' inverse_name='cutoff_from_id' readonly=True string='Cut-off entries'
  • cutoff_from_id Many2one → account.move
    comodel_name='account.move' help='Source entry that generate the current deferred revenue/expense entry' string='Cut-off source entry'
  • cutoff_move_count Integer
    compute='_compute_cutoff_move_count'
Public methods (2)
  • action_view_deferred_entries(self)
  • button_draft(self)

New fields (6)
  • cutoff_ids One2many → account.move.line
    comodel_name='account.move.line' help='Field use to make easy to user to follow items generated from this specific entry to deferred revenues or expenses.' inverse_name='cutoff_source_id' readonly=True string='Cut-off items'
  • cutoff_method Selection
    default='monthly_prorata_temporis' help='Determine how to split amounts over periods:\n * Equal: same amount is splitted over periods of the service (using start and end date on the invoice line).\n * Prorata temporis by month %: amount is splitted over the rate of service days in the month.\n' required=True string='Cut-off method' args: [('equal', 'Equal'), ('monthly_prorata_temporis', 'Prorata temporis (by month %)')]
  • cutoff_source_id Many2one → account.move.line
    comodel_name='account.move.line' help='Source journal item that generate the current deferred revenue/expense item' readonly=True string='Cut-off source item'
  • cutoff_source_move_id Many2one → account.move
    comodel_name='account.move' readonly=True related='cutoff_source_id.move_id' store=True string='Cut-off source entry'
  • deferred_accrual_account_id Many2one → account.account
    comodel_name='account.account' help='Use related field to abstract the way to get deferred accrual account. This will give the possibility to overwrite the way to configure it. For instance to use the same account without any configuration while creating new account.' related='account_id.deferred_accrual_account_id' string='Revenue/Expense accrual account'
  • is_deferrable_line Boolean
    compute='_compute_is_deferrable_line' help='Field used to detect lines to cut-off' string='Is deferrable line'
Public methods (1)
  • has_deferred_dates(self)
    Compute the account move line should be split: has service in future periods

New fields (0)

No new fields.

Public methods (1)
  • group_recordset_by(self, key)
    Return a collection of pairs ``(key, recordset)`` from ``self``. The ``key`` is a function computing a key value for each element. This function is similar to ``itertools.groupby``, but aggregates all elements under the same key, not only consecutive elements. it's also similar to ``òdoo.tools.misc.groupby`` but return a recordset of account.move.line instead empty list this let write some code likes this:: my_recordset.filtered( lambda record: record.to_use ).group_recordset_by( lambda record: record.type ) # TODO: consider moving this method on odoo.models.Model

New fields (2)
  • expense_cutoff_journal_id Many2one → account.journal
    check_company=True string='Cut-off Expense Journal' args: 'account.journal'
  • revenue_cutoff_journal_id Many2one → account.journal
    check_company=True string='Cut-off Revenue Journal' args: 'account.journal'
Public methods (0)

No public methods.

New fields (4)
  • default_cutoff_method Selection
    default='monthly_prorata_temporis' default_model='account.move.line' help='Determine how to split amounts over periods:\n * Equal: same amount is splitted over periods of the service (using start and end date on the invoice line).\n * Prorata temporis by month %: amount is splitted over the rate of service days in the month.\n' required=True string='Default Cutoff method' args: [('equal', 'Equal'), ('monthly_prorata_temporis', 'Prorata temporis (by month %)')]
  • expense_cutoff_journal_id Many2one
    readonly=False related='company_id.expense_cutoff_journal_id' string='Expense cut-off journal'
  • link_product Boolean
    config_parameter='account_move_cutoff.link_product' help='Link product on deferred account.move.line.' args: 'Link product'
  • revenue_cutoff_journal_id Many2one
    readonly=False related='company_id.revenue_cutoff_journal_id' string='Revenue cut-off journal'
Public methods (0)

No public methods.

Loading…