Repository
OCA/account-financial-tools · module folder · Try on Runboat
Module version
1.0.2
Category
Accounting
Folder size
2.85 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), Creu Blanca
Maintainers
Odoo Community Association (OCA), Creu Blanca
Committers
Weblate, OCA-git-bot, oca-ci, juancarlosonate-tecnativa, Bhavesh Heliconia
Odoo dependencies
Python dependencies
numpy-financial<=1.0.0, numpy>=1.15
System dependencies
libatlas-base-dev
Required by
None
Description
This module extends the functionality of accounting to support loans. It
will create automatically moves or invoices for loans. Moreover, you can
check the pending amount to be paid and reduce the debt.

It currently supports two kinds of debts:

- Loans: a standard debt with banks, that only creates account moves.  
  Loan types info:
  [APR](https://en.wikipedia.org/wiki/Annual_percentage_rate),
  [EAR](https://en.wikipedia.org/wiki/Effective_interest_rate), [Real
  Rate](https://en.wikipedia.org/wiki/Real_interest_rate).

- Leases: a debt with a bank where purchase invoices are necessary

Code Analysis

Views touched (14)
XML IDNameModelTypeStatus
account_loan_form account.loan.form account.loan form New
account_loan_generate_wizard_form Pay amount account.loan.generate.wizard form New
account_loan_increase_amount_form_view account.loan.increase.amount.form (in account_loan) account.loan.increase.amount form New
account_loan_line_form account.loan.line.form account.loan.line form New
account_loan_line_tree account.loan.line.tree account.loan.line list New
account_loan_lines_view account.loan.lines.view account.loan.line list New
account_loan_pay_amount_form Pay amount account.loan.pay.amount form New
account_loan_pivot account.loan.pivot account.loan pivot New
account_loan_post_form Post loan account.loan.post form New
account_loan_search account.loan.tree account.loan search New
account_loan_tree account.loan.tree account.loan list New
res_partner_form_view res.partner.form (in account_loan) res.partner form Inherits base.view_partner_form
view_account_loan_lines_search Loan Items account.loan.line search New
view_move_form Add to_be_reversed and reversal_id fields account.move form Inherits account.view_move_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (8)

New fields (35)
  • company_id Many2one → res.company
    default=_default_company required=True args: 'res.company'
  • currency_id Many2one → res.currency
    compute='_compute_currency' readonly=True args: 'res.currency'
  • fixed_amount Monetary
    compute='_compute_fixed_amount' currency_field='currency_id'
  • fixed_loan_amount Monetary
    copy=False currency_field='currency_id' default=0 readonly=True
  • fixed_periods Integer
    copy=False default=0 readonly=True
  • interest_expenses_account_id Many2one → account.account
    domain="[('company_ids', '=', company_id)]" help='Account where the interests will be assigned to' required=True string='Interests account' args: 'account.account'
  • interests_amount Monetary
    compute='_compute_total_amounts' currency_field='currency_id' string='Total interests payed'
  • interests_product_id Many2one → product.product
    help='Product where the amount of interests will be assigned when the invoice is created' string='Interest product' args: 'product.product'
  • is_leasing Boolean
  • journal_id Many2one → account.journal
    domain="[('company_id', '=', company_id),('type', '=', journal_type)]" required=True args: 'account.journal'
  • journal_type Char
    compute='_compute_journal_type'
  • leased_asset_account_id Many2one → account.account
    domain="[('company_ids', '=', company_id)]" args: 'account.account'
  • line_ids One2many → account.loan.line
    copy=False inverse_name='loan_id' readonly=True args: 'account.loan.line'
  • loan_amount Monetary
    currency_field='currency_id' required=True
  • loan_type Selection
    default='fixed-annuity' help='Method of computation of the period annuity' required=True args: [('fixed-annuity', 'Fixed Annuity'), ('fixed-annuity-begin', 'Fixed Annuity Begin'), ('fixed-principal', 'Fixed Principal'), ('interest', 'Only interest')]
  • long_term_loan_account_id Many2one → account.account
    domain="[('company_ids', '=', company_id)]" help='Account that will contain the pending amount on Long term' string='Long term account' args: 'account.account'
  • method_period Integer
    default=1 help='State here the time between 2 depreciations, in months' required=True string='Period Length'
  • move_count Integer
    compute='_compute_move_count'
  • move_ids One2many → account.move
    copy=False inverse_name='loan_id' args: 'account.move'
  • name Char
    copy=False default='/' required=True
  • partner_id Many2one → res.partner
    help='Company or individual that lends the money at an interest rate.' required=True string='Lender' args: 'res.partner'
  • payment_amount Monetary
    compute='_compute_total_amounts' currency_field='currency_id' string='Total payed amount'
  • payment_on_first_period Boolean
    help='When checked, the first payment will be on start date'
  • pending_principal_amount Monetary
    compute='_compute_total_amounts' currency_field='currency_id'
  • periods Integer
    help='Number of periods that the loan will last' required=True
  • post_invoice Boolean
    default=True help='Invoices will be posted automatically'
  • product_id Many2one → product.product
    help='Product where the amount of the loan will be assigned when the invoice is created' string='Loan product' args: 'product.product'
  • rate Float
    default=0.0 digits=(8, 6) help='Currently applied rate' required=True tracking=True
  • rate_period Float
    compute='_compute_rate_period' digits=(8, 6) help='Real rate that will be applied on each period'
  • rate_type Selection
    default='napr' help='Method of computation of the applied rate' required=True args: [('napr', 'Nominal APR'), ('ear', 'EAR'), ('real', 'Real rate')]
  • residual_amount Monetary
    currency_field='currency_id' default=0.0 help='Residual amount of the lease that must be payed on the end in order to acquire the asset' required=True
  • round_on_end Boolean
    help='When checked, the differences will be applied on the last period, if it is unchecked, the annuity will be recalculated on each period.'
  • short_term_loan_account_id Many2one → account.account
    domain="[('company_ids', '=', company_id)]" help='Account that will contain the pending amount on short term' required=True string='Short term account' args: 'account.account'
  • start_date Date
    copy=False help='Start of the moves'
  • state Selection
    copy=False default='draft' required=True args: [('draft', 'Draft'), ('posted', 'Posted'), ('cancelled', 'Cancelled'), ('closed', 'Closed')]
Public methods (7)
  • button_draft(self)
  • close(self)
  • compute_lines(self)
  • create(self, vals_list)
    @api.model_create_multi
  • post(self)
  • view_account_invoices(self)
  • view_account_moves(self)

New fields (2)
  • date Date
    default=fields.Date.context_today help='Choose the period for which you want to automatically post the depreciation lines of running assets' required=True args: 'Account Date'
  • loan_type Selection
    default='loan' required=True args: [('leasing', 'Leasings'), ('loan', 'Loans')]
Public methods (1)
  • run(self)

New fields (6)
  • account_id Many2one → account.account
    default=<expr> required=True args: 'account.account'
  • amount Monetary
    currency_field='currency_id' string='Amount to reduce from Principal'
  • currency_id Many2one → res.currency
    readonly=True related='loan_id.currency_id' args: 'res.currency'
  • date Date
    default=fields.Date.today() required=True
  • journal_id Many2one → account.journal
    default=<expr> required=True args: 'account.journal'
  • loan_id Many2one → account.loan
    readonly=True required=True args: 'account.loan'
Public methods (2)
  • new_line_vals(self, sequence)
  • run(self)

New fields (25)
  • company_id Many2one → res.company
    related='loan_id.company_id' store=True args: 'res.company'
  • currency_id Many2one → res.currency
    related='loan_id.currency_id' args: 'res.currency'
  • date Date
    help='Date when the payment will be accounted' readonly=True required=True
  • final_pending_principal_amount Monetary
    compute='_compute_amounts' currency_field='currency_id' help='Pending amount of the loan after the payment' store=True
  • has_invoices Boolean
    compute='_compute_has_invoices'
  • has_moves Boolean
    compute='_compute_has_moves'
  • interest_expenses_account_id Many2one → account.account
    related='loan_id.interest_expenses_account_id' args: 'account.account'
  • interests_amount Monetary
    compute='_compute_interests_amount' currency_field='currency_id' help='Amount of the payment that will be assigned to interests' readonly=False store=True
  • is_leasing Boolean
    related='loan_id.is_leasing'
  • journal_id Many2one → account.journal
    related='loan_id.journal_id' args: 'account.journal'
  • loan_id Many2one → account.loan
    ondelete='cascade' readonly=True required=True args: 'account.loan'
  • loan_state Selection
    readonly=True related='loan_id.state' store=True
  • loan_type Selection
    related='loan_id.loan_type'
  • long_term_loan_account_id Many2one → account.account
    related='loan_id.long_term_loan_account_id' args: 'account.account'
  • long_term_pending_principal_amount Monetary
    currency_field='currency_id' help='Pending amount of the loan before the payment that will not be payed in, at least, 12 months' readonly=True
  • long_term_principal_amount Monetary
    currency_field='currency_id' help='Amount that will reduce the pending loan amount on long term' readonly=True
  • move_ids One2many → account.move
    inverse_name='loan_line_id' args: 'account.move'
  • name Char
    compute='_compute_name'
  • partner_id Many2one → res.partner
    related='loan_id.partner_id' args: 'res.partner'
  • payment_amount Monetary
    compute='_compute_payment_amount' currency_field='currency_id' help='Total amount that will be payed (Annuity)' readonly=False store=True
  • pending_principal_amount Monetary
    currency_field='currency_id' help='Pending amount of the loan before the payment' readonly=False
  • principal_amount Monetary
    compute='_compute_principal_amount' currency_field='currency_id' help='Amount of the payment that will reduce the pending loan amount' store=True
  • rate Float
    compute='_compute_rate' digits=(8, 6) readonly=False required=True store=True
  • sequence Integer
    readonly=True required=True
  • short_term_loan_account_id Many2one → account.account
    related='loan_id.short_term_loan_account_id' args: 'account.account'
Public methods (4)
  • view_account_invoices(self)
  • view_account_moves(self)
  • view_account_values(self)
    Shows the invoice if it is a leasing or the move if it is a loan
  • view_process_values(self)
    Computes the annuity and returns the result

New fields (6)
  • amount Monetary
    currency_field='currency_id' string='Amount to reduce from Principal'
  • cancel_loan Boolean
    default=False
  • currency_id Many2one → res.currency
    readonly=True related='loan_id.currency_id' args: 'res.currency'
  • date Date
    default=fields.Date.today() required=True
  • fees Monetary
    currency_field='currency_id' string='Bank fees'
  • loan_id Many2one → account.loan
    readonly=True required=True args: 'account.loan'
Public methods (2)
  • new_line_vals(self, sequence)
  • run(self)

New fields (3)
  • account_id Many2one → account.account
    default=<expr> required=True args: 'account.account'
  • journal_id Many2one → account.journal
    default=<expr> required=True args: 'account.journal'
  • loan_id Many2one → account.loan
    readonly=True required=True args: 'account.loan'
Public methods (3)
  • move_line_vals(self)
  • move_vals(self)
  • run(self)

New fields (2)
  • loan_id Many2one → account.loan
    ondelete='restrict' readonly=True store=True args: 'account.loan'
  • loan_line_id Many2one → account.loan.line
    ondelete='restrict' readonly=True args: 'account.loan.line'
Public methods (1)
  • action_post(self)

New fields (2)
  • lended_loan_count Integer
    compute='_compute_lended_loan_count' help='How many Loans this partner lended to us ?'
  • lended_loan_ids One2many → account.loan
    inverse_name='partner_id' args: 'account.loan'
Public methods (1)
  • action_view_partner_lended_loans(self)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…