Repository
OCA/account-financial-tools · module folder · Try on Runboat
Module version
1.0.0
Category
Accounting/Accounting
Folder size
1.58 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/account-financial-tools
Last tracking update
2026-08-07 09:06:24
Authors
Akretion, Vauxoo, Odoo Community Association (OCA), Agile Business Group, Aurium Technologies, ForgeFlow
Maintainers
Akretion, Vauxoo, Odoo Community Association (OCA), Agile Business Group, Aurium Technologies, ForgeFlow
Committers
Weblate, OCA-git-bot, oca-ci, Bhavesh Heliconia
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
The user can configure journal entries templates, useful for recurring
entries. The amount of each template line can be computed (through
python code) or kept as user input.

If user input, when using the template, user has to fill the amount of
every input lines.

The journal entry form allows lo load, through a wizard, the template to
use and the amounts to fill.

**Notable features:**

This module enhance the capability of module account_move_template with
following features,

1.  Optional account for negative amount.

    > When the Journal entry is created, and credit/debit is negative
    > value, change debit/credit side and use the opt_account_id

2.  Allow overwrite move line values with overwrite dict.

    > Normally, the journal items created by the template will require
    > user input on wizard. This feature allow passing the overwrite
    > values with a dictionary. This is particularly useful when the
    > wizard is called by code.
    >
    > Sample of dictionary to overwrite move lines:
    >
    >     {'L1': {'partner_id': 1, 'amount': 100, 'name': 'some label'},
    >      'L2': {'partner_id': 2, 'amount': 200, 'name': 'some label 2'}, }

Code Analysis

Views touched (6)
XML IDNameModelTypeStatus
account_move_template_form account.move.template.form account.move.template form New
account_move_template_line_form account.move.template.line.form account.move.template.line form New
account_move_template_line_tree account.move.template.line.list account.move.template.line list New
account_move_template_run_form account.move.template.run form New
account_move_template_search account.move.template.search account.move.template search New
account_move_template_tree account.move.template.list account.move.template list New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (4)

New fields (6)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> ondelete='cascade' required=True string='Company' args: 'res.company'
  • journal_id Many2one → account.journal
    check_company=True domain="[('company_id', '=', company_id)]" required=True string='Journal' args: 'account.journal'
  • line_ids One2many → account.move.template.line
    inverse_name='template_id' string='Lines' args: 'account.move.template.line'
  • name Char
    required=True
  • ref Char
    copy=False string='Reference'
Public methods (4)
  • compute_lines(self, sequence2amount)
  • copy(self, default=None)
  • eval_computed_line(self, line, sequence2amount)
  • generate_journal_entry(self)
    Called by the button on the form view

New fields (17)
  • account_id Many2one → account.account
    check_company=True domain="[('company_ids', 'in', company_id), ('active', '=', True)]" required=True string='Account' args: 'account.account'
  • company_currency_id Many2one
    related='template_id.company_id.currency_id' store=True string='Company Currency'
  • company_id Many2one
    related='template_id.company_id' store=True
  • is_refund Boolean
    default=False string='Is a refund?'
  • move_line_type Selection
    required=True string='Direction' args: [('cr', 'Credit'), ('dr', 'Debit')]
  • name Char
    string='Label'
  • note Char
  • opt_account_id Many2one → account.account
    check_company=True domain="[('company_ids', 'in', company_id), ('active', '=', True)]" help='When amount is negative, use this account instead' string='Account if Negative' args: 'account.account'
  • partner_id Many2one → res.partner
    domain=['|', ('parent_id', '=', False), ('is_company', '=', True)] string='Partner' args: 'res.partner'
  • payment_term_id Many2one → account.payment.term
    check_company=True help='Used to compute the due date of the journal item.' string='Payment Terms' args: 'account.payment.term'
  • python_code Text
    string='Formula'
  • sequence Integer
    required=True
  • tax_ids Many2many → account.tax
    check_company=True string='Taxes' args: 'account.tax'
  • tax_line_id Many2one → account.tax
    check_company=True ondelete='restrict' string='Originator Tax' args: 'account.tax'
  • tax_repartition_line_id Many2one → account.tax.repartition.line
    compute='_compute_tax_repartition_line_id' store=True string='Tax Repartition Line' args: 'account.tax.repartition.line'
  • template_id Many2one → account.move.template
    ondelete='cascade' string='Move Template' args: 'account.move.template'
  • type Selection
    default='input' required=True args: [('input', 'User input'), ('computed', 'Computed')]
Public methods (0)

No public methods.

New fields (15)
  • account_id Many2one → account.account
    readonly=True required=True args: 'account.account'
  • amount Monetary
    currency_field='company_currency_id' required=True
  • company_currency_id Many2one
    related='wizard_id.company_id.currency_id' string='Company Currency'
  • company_id Many2one
    related='wizard_id.company_id'
  • is_refund Boolean
    readonly=True string='Is a refund?'
  • move_line_type Selection
    readonly=True required=True string='Direction' args: [('cr', 'Credit'), ('dr', 'Debit')]
  • name Char
    readonly=True
  • note Char
    readonly=True
  • partner_id Many2one → res.partner
    readonly=True string='Partner' args: 'res.partner'
  • payment_term_id Many2one → account.payment.term
    readonly=True string='Payment Terms' args: 'account.payment.term'
  • sequence Integer
    required=True
  • tax_ids Many2many → account.tax
    readonly=True string='Taxes' args: 'account.tax'
  • tax_line_id Many2one → account.tax
    ondelete='restrict' readonly=True string='Originator Tax' args: 'account.tax'
  • tax_repartition_line_id Many2one → account.tax.repartition.line
    readonly=True string='Tax Repartition Line' args: 'account.tax.repartition.line'
  • wizard_id Many2one → account.move.template.run
    ondelete='cascade' args: 'account.move.template.run'
Public methods (0)

No public methods.

New fields (9)
  • company_id Many2one → res.company
    default=<expr> readonly=True required=True args: 'res.company'
  • date Date
    default=fields.Date.context_today required=True
  • journal_id Many2one → account.journal
    readonly=True string='Journal' args: 'account.journal'
  • line_ids One2many → account.move.template.line.run
    string='Lines' args: 'account.move.template.line.run', 'wizard_id'
  • overwrite Text
    help="\nValid dictionary to overwrite template lines:\n{'L1': {'partner_id': 1, 'amount': 100, 'name': 'some label'},\n 'L2': {'partner_id': 2, 'amount': 200, 'name': 'some label 2'}, }\n "
  • partner_id Many2one → res.partner
    domain=['|', ('parent_id', '=', False), ('is_company', '=', True)] args: 'res.partner', 'Override Partner'
  • ref Char
    string='Reference'
  • state Selection
    default='select_template' readonly=True args: [('select_template', 'Select Template'), ('set_lines', 'Set Lines')]
  • template_id Many2one → account.move.template
    check_company=True domain="[('company_id', '=', company_id)]" required=True args: 'account.move.template'
Public methods (2)
  • generate_move(self)
  • load_lines(self)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…