Repository
OCA/credit-control · module folder · Try on Runboat
Module version
1.0.0
Category
Finance
Folder size
6.0 MB
License
AGPL-3
Application
Yes
Auto-installable
No
Website
https://github.com/OCA/credit-control
Last tracking update
2026-08-07 09:06:36
Authors
Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA), Tecnativa, Okia, Access Bookings
Maintainers
Camptocamp
Committers
Weblate, OCA-git-bot, oca-ci, andrea
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
Account Credit Control module is a part of Financial Tools used in
business to ensure that once sales are made they are realised as cash.
This module helps to identify outstanding debt beyond tolerance level
and setup followup method.

Code Analysis

Views touched (28)
XML IDNameModelTypeStatus
credit_control_analysis_pivot_view credit.control.analysis.pivot (in account_credit_control_analysis) credit.control.analysis pivot New
credit_control_analysis_tree_view credit.control.analysis.tree (in account_credit_control_analysis) credit.control.analysis list New
credit_control_communication_form_view credit.control.communication.form credit.control.communication form New
credit_control_communication_search_view Credit Control Communications credit.control.communication search New
credit_control_communication_tree_view credit.control.communication.list credit.control.communication list New
credit_control_company_form credit.control.company.form res.company form Inherits base.view_company_form
credit_control_line_form credit.control.line.form credit.control.line form New
credit_control_line_search Credit Control Lines credit.control.line search New
credit_control_line_tree credit.control.line.list credit.control.line list New
credit_control_policy_changer_form credit control policy form credit.control.policy.changer form New
credit_control_policy_form credit.control.policy.form credit.control.policy form New
credit_control_policy_level_tree credit.control.policy.level.list credit.control.policy.level list New
credit_control_policy_tree credit.control.policy.list credit.control.policy list New
credit_control_run_form credit.control.run.form credit.control.run form New
credit_control_run_tree credit.control.run.list credit.control.run list New
credit_line_emailer_form credit.line.emailer.form credit.control.emailer form New
credit_line_marker_form credit.line.marker.form credit.control.marker form New
credit_line_printer_form credit.line.printer.form credit.control.printer form New
credit_mangement_policy_level_form credit.mangement.policy.level.form credit.control.policy.level form New
customer_followup_tree res.partner.followup.inherit.list res.partner list New
partner_followup_form_view partner.credit_control.form.view res.partner form Inherits account.view_partner_property_form
partner_view_buttons res.partner Inherits account.partner_view_buttons
report_credit_control_summary report_credit_control_summary ir.ui.view qweb New
report_credit_control_summary_document report_credit_control_summary_document ir.ui.view qweb New
res_config_settings_view_form res.config.settings.view.form.inherit.credit.control res.config.settings form Inherits account.res_config_settings_view_form
res_partner_payment_action_type_form_view res.partner.payment.action.type.form res.partner.payment.action.type form New
res_partner_payment_action_type_tree_view res.partner.payment.action.type.form res.partner.payment.action.type list New
view_move_form invoice.move.form account.move form Inherits account.view_move_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (18)

New fields (1)
  • credit_control_line_ids One2many → credit.control.line
    comodel_name='credit.control.line' inverse_name='account_id' readonly=True string='Credit Lines'
Public methods (0)

No public methods.

New fields (2)
  • credit_control_line_ids One2many → credit.control.line
    comodel_name='credit.control.line' copy=False inverse_name='invoice_id' readonly=True string='Credit Lines'
  • credit_policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' copy=False groups='account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user,account_credit_control.group_account_credit_control_info' help='The Credit Control Policy used for this invoice. If nothing is defined, it will use the account setting or the partner setting.' readonly=True string='Credit Control Policy'
Public methods (1)
  • button_cancel(self)
    Prevent to cancel invoice related to credit line

New fields (8)
  • company_id Many2one → res.company
    comodel_name='res.company' readonly=True
  • currency_id Many2one → res.currency
    comodel_name='res.currency' readonly=True
  • level Integer
    readonly=True string='Max Level'
  • open_balance Float
    help='Open balance on credit control lines of same partner, policy and currency' readonly=True string='Overdue Balance'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=True
  • partner_ref Char
    readonly=True
  • policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' readonly=True
  • policy_level_id Many2one → credit.control.policy.level
    comodel_name='credit.control.policy.level' readonly=True string='Overdue Level'
Public methods (1)
  • init(self)

New fields (11)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True required=True
  • contact_address_id Many2one → res.partner
    comodel_name='res.partner' index=True readonly=True
  • credit_control_line_ids One2many → credit.control.line
    comodel_name='credit.control.line' inverse_name='communication_id' string='Credit Lines'
  • currency_id Many2one → res.currency
    comodel_name='res.currency' index=True required=True
  • partner_id Many2one → res.partner
    comodel_name='res.partner' index=True required=True
  • policy_id Many2one
    index=True related='policy_level_id.policy_id' store=True
  • policy_level_id Many2one → credit.control.policy.level
    comodel_name='credit.control.policy.level' index=True required=True string='Level'
  • report_date Date
    default=<expr>
  • total_due Float
    compute='_compute_total'
  • total_invoiced Float
    compute='_compute_total'
  • user_id Many2one → res.users
    comodel_name='res.users' default=<expr> index=True
Public methods (2)
  • get_email(self)
    Kept for backwards compatibility. To be removed in v13/v14
  • get_emailing_contact(self)
    Return a valid customer for the emailing. If the contact address doesn't have a valid email we fallback to the commercial partner

New fields (1)
  • line_ids Many2many → credit.control.line
    comodel_name='credit.control.line' default=<expr> domain=[('state', '=', 'to_be_sent'), ('channel', '=', 'email')] string='Credit Control Lines'
Public methods (1)
  • email_lines(self)

New fields (23)
  • account_id Many2one → account.account
    comodel_name='account.account' related='move_line_id.account_id' store=True
  • amount_due Float
    readonly=True required=True string='Due Amount Tax incl.'
  • balance_due Float
    readonly=True required=True string='Due balance'
  • channel Selection
    readonly=False required=True selection=CHANNEL_LIST
  • commercial_partner_id Many2one → res.partner
    comodel_name='res.partner' compute_sudo=True index=True related='partner_id.commercial_partner_id' store=True string='Commercial Entity'
  • communication_id Many2one → credit.control.communication
    comodel_name='credit.control.communication' help='Credit control communication process where this line belongs' string='Communication process'
  • company_id Many2one → res.company
    comodel_name='res.company' related='move_line_id.company_id' store=True
  • currency_id Many2one → res.currency
    comodel_name='res.currency' related='move_line_id.currency_id' store=True
  • date Date
    index=True readonly=False required=True string='Controlling date'
  • date_due Date
    readonly=False required=True string='Due date'
  • date_entry Date
    related='move_line_id.date' store=True string='Entry date'
  • date_sent Date
    readonly=False string='Reminded date'
  • invoice_id Many2one → account.move
    comodel_name='account.move' readonly=True
  • level Integer
    aggregator='max' related='policy_level_id.level' store=True
  • manual_followup Boolean
  • manually_overridden Boolean
  • move_line_id Many2one → account.move.line
    comodel_name='account.move.line' index=True readonly=True required=True string='Move line'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=False required=True
  • partner_user_id Many2one → res.users
    comodel_name='res.users' compute='_compute_partner_user_id' store=True string='Salesperson'
  • policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' related='policy_level_id.policy_id' store=True
  • policy_level_id Many2one → credit.control.policy.level
    comodel_name='credit.control.policy.level' readonly=False required=True string='Overdue Level'
  • run_id Many2one → credit.control.run
    comodel_name='credit.control.run' string='Source'
  • state Selection
    default='draft' help='Draft lines need to be triaged.\nIgnored lines are lines for which we do not want to send something.\nDraft and ignored lines will be generated again on the next run.' readonly=True required=True selection=[('draft', 'Draft'), ('ignored', 'Ignored'), ('queued', 'Queued'), ('to_be_sent', 'To Do'), ('sent', 'Done'), ('error', 'Error'), ('email_error', 'Emailing Error')] tracking=True
Public methods (3)
  • create_or_update_from_mv_lines(self, lines, level, controlling_date, company, check_tolerance=True, default_lines_vals=None)
    @api.model
    Create or update line based on levels if check_tolerance is true credit line will not be created if open amount is too small. eg. we do not want to send a letter for 10 cents of open amount. :param lines: move.line id recordset :param level: credit.control.policy.level record :param controlling_date: date string of the credit controlling date. Generally it should be the same as create date :param company: res.company :param default_lines_vals: default values to create new credit control lines with :param check_tolerance: boolean if True credit line will not be generated if open amount is smaller than company defined tolerance :returns: recordset of created credit lines
  • unlink(self)
  • write(self, values)

New fields (2)
  • line_ids Many2many → credit.control.line
    comodel_name='credit.control.line' default=<expr> domain="[('state', '!=', 'sent')]" string='Credit Control Lines'
  • name Selection
    default='to_be_sent' required=True selection=[('draft', 'Draft'), ('ignored', 'Ignored'), ('to_be_sent', 'To Do'), ('sent', 'Done')] string='Mark as'
Public methods (1)
  • mark_lines(self)
    Write state of selected credit lines to the one in entry done credit line will be ignored

New fields (7)
  • account_ids Many2many → account.account
    comodel_name='account.account' domain="[('account_type', '=', 'asset_receivable')]" help='This policy will be active only for the selected accounts' required=True string='Accounts'
  • active Boolean
    default=True
  • apply_max_policy_level Boolean
    help='Apply max policy level for one partner in a credit control run execution to have all credit control lines on same communication level' string='Apply max policy level'
  • company_id Many2one → res.company
    comodel_name='res.company'
  • do_nothing Boolean
    help='For policies which should not generate lines or are obsolete'
  • level_ids One2many → credit.control.policy.level
    comodel_name='credit.control.policy.level' copy=True inverse_name='policy_id' string='Policy Levels'
  • name Char
    required=True
Public methods (1)
  • check_policy_against_account(self, account)
    Ensure that the policy corresponds to account relation

New fields (4)
  • do_nothing Boolean
    string='No follow policy'
  • move_line_ids Many2many → account.move.line
    comodel_name='account.move.line' default=<expr> relation='credit_changer_ml_rel' string='Move line to change'
  • new_policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' required=True string='New Policy to Apply'
  • new_policy_level_id Many2one → credit.control.policy.level
    comodel_name='credit.control.policy.level' required=True string='New level to apply'
Public methods (2)
  • onchange_policy_id(self)
    @api.onchange('new_policy_level_id')
  • set_new_policy(self)
    Set new policy on an invoice. This is done by creating a new credit control line related to the move line and the policy settled in the wizard form :return: ir.actions.act_windows dict

New fields (11)
  • channel Selection
    required=True selection=CHANNEL_LIST
  • computation_mode Selection
    required=True selection=[('net_days', 'Due Date'), ('end_of_month', 'Due Date, End Of Month'), ('previous_date', 'Previous Reminder')] string='Compute Mode'
  • custom_mail_text Html
    required=True string='Custom Mail Message' translate=True
  • custom_text Text
    required=True string='Custom Message' translate=True
  • custom_text_after_details Text
    string='Custom Message after details' translate=True
  • delay_days Integer
    required=True string='Delay (in days)'
  • email_template_id Many2one → mail.template
    comodel_name='mail.template' domain=[('model', '=', 'credit.control.communication')] required=True
  • level Integer
    required=True
  • mail_show_invoice_detail Boolean
    string='Show Invoice Details in mail'
  • name Char
    required=True translate=True
  • policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' ondelete='cascade' required=True string='Related Policy'
Public methods (1)
  • get_level_lines(self, controlling_date, lines)
    get all move lines in entry lines that match the current level

New fields (2)
  • line_ids Many2many → credit.control.line
    comodel_name='credit.control.line' default=<expr> string='Credit Control Lines'
  • mark_as_sent Boolean
    default=True help='Only letter lines will be marked.' string='Mark letter lines as done'
Public methods (1)
  • print_lines(self)

New fields (10)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True readonly=False
  • credit_control_communication_count Integer
    compute='_compute_credit_control_count' string='# of Credit Control Communications'
  • credit_control_count Integer
    compute='_compute_credit_control_count' string='# of Credit Control Lines'
  • date Date
    readonly=False required=True string='Controlling Date'
  • hide_change_state_button Boolean
  • line_ids One2many → credit.control.line
    comodel_name='credit.control.line' inverse_name='run_id' string='Generated lines'
  • manual_ids Many2many → account.move.line
    comodel_name='account.move.line' copy=False help='If a credit control line has been generatedon a policy and the policy has been changed in the meantime, it has to be handled manually' readonly=True relation='credit_runreject_rel' string='Lines to handle manually'
  • policy_ids Many2many → credit.control.policy
    column1='run_id' column2='policy_id' comodel_name='credit.control.policy' default=<expr> readonly=False relation='credit_run_policy_rel' string='Policies'
  • report Html
    copy=False readonly=True
  • state Selection
    default='draft' readonly=True required=True selection=[('draft', 'Draft'), ('done', 'Done')]
Public methods (6)
  • generate_credit_lines(self)
    Generate credit control lines Lock the ``credit_control_run`` Postgres table to avoid concurrent calls of this method.
  • open_credit_communications(self)
    Open the generated communications.
  • open_credit_lines(self)
    Open the generated lines
  • run_channel_action(self)
  • set_to_ready_lines(self)
  • unlink(self)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • credit_control_tolerance Float
    default=0.1 readonly=False
  • credit_policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' help='The Credit Control Policy used on partners by default. This setting can be overridden on partners or invoices.' readonly=False string='Credit Control Policy'
Public methods (0)

No public methods.

New fields (3)
  • credit_control_tolerance Float
    readonly=False related='company_id.credit_control_tolerance'
  • credit_policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' help='The Credit Control Policy used on partners by default. This setting can be overridden on partners or invoices.' readonly=False related='company_id.credit_policy_id' string='Credit Control Policy'
  • default_apply_max_policy_level Boolean
    default_model='credit.control.policy' help='Apply max policy lavel for one partner in a credit control run execution to have all credit control lines on same communication level' string='Apply max policy level'
Public methods (0)

No public methods.

New fields (9)
  • credit_control_analysis_ids One2many → credit.control.analysis
    groups='account_credit_control.group_account_credit_control_info' string='Credit Control Levels' args: 'credit.control.analysis', 'partner_id'
  • credit_control_count Integer
    compute='_compute_credit_control_count' string='# of Credit Control Lines'
  • credit_policy_id Many2one → credit.control.policy
    comodel_name='credit.control.policy' help='The Credit Control Policy used for this partner. This setting can be forced on the invoice. If nothing is defined, it will use the company setting.' string='Credit Control Policy'
  • manual_followup Boolean
  • payment_next_action Text
    help='This is the next action to be taken.' string='Next Action' tracking=True
  • payment_next_action_date Date
    help='This is when the manual follow-up is needed.' string='Next Action Date' tracking=True
  • payment_next_action_type Many2one → res.partner.payment.action.type
    comodel_name='res.partner.payment.action.type' string='Next Action Type' tracking=True
  • payment_note Text
    help='Payment Note' string='Customer Payment Promise' tracking=True
  • payment_responsible_id Many2one → res.users
    comodel_name='res.users' help='Optionally you can assign a user to this field, which will make him responsible for the action.' ondelete='set null' string='Follow-up Responsible' tracking=True
Public methods (0)

No public methods.

New fields (5)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> args: 'res.company'
  • name Char
  • partner_ids One2many → res.partner
    comodel_name='res.partner' inverse_name='payment_next_action_type' string='Partners'
  • sequence Integer
    default=10
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…