Skip to Content
Skip to content
Odoo Functional

Customer Credit Limits in Odoo: Warn, Hold or Block Risky Orders

Use Odoo's built-in credit warning, then add the hold-and-approve step finance teams actually ask for.

  • Published
  • 3 minReading time
  • 5Sections
Customer Credit Limits in Odoo: Warn, Hold or Block Risky Orders

For distributors and manufacturers that sell on credit, one bad customer can wipe out a quarter's margin. Credit limits are one of the first controls finance asks for in an Odoo project, and one of the most misunderstood, because the standard feature warns but does not block.

The standard feature

Enable Accounting ▸ Configuration ▸ Settings ▸ Sales Credit Limit and set a default limit. Each customer can then have its own limit on the contact form (Invoicing tab). When a quotation would push the customer over the limit, Odoo shows a warning banner on the sales order, and on invoices too.

That is useful information, but the salesperson can still confirm the order and the warehouse will happily ship it.

Count the real exposure

The receivable balance alone underestimates the risk. The figure that matters is:

exposure = unpaid invoices
         + confirmed orders not yet invoiced
         + this order

In Odoo terms that's the commercial partner's credit (receivable balance), plus the amount_to_invoice of its confirmed sales orders, plus the amount of the order being confirmed. Always work on the commercial partner, so delivery addresses and contacts of the same company share one limit.

Turning the warning into a control

The workflow I implement most often:

  1. The salesperson clicks Confirm.
  2. If the exposure is within the limit, the order confirms as usual.
  3. If not, the order goes on hold and an activity is created for the credit controller, with the exposure breakdown in the chatter.
  4. Finance approves (once, for this order) or rejects with a reason.
class SaleOrder(models.Model):
    _inherit = 'sale.order'

    credit_approved = fields.Boolean(copy=False, tracking=True)

    def _credit_exposure(self):
        self.ensure_one()
        partner = self.partner_id.commercial_partner_id
        open_orders = self.search([
            ('partner_id', 'child_of', partner.id),
            ('state', '=', 'sale'), ('id', '!=', self.id),
        ])
        return partner.credit + sum(open_orders.mapped('amount_to_invoice')) + self.amount_total

    def action_confirm(self):
        for order in self:
            partner = order.partner_id.commercial_partner_id
            if (partner.credit_limit and not order.credit_approved
                    and order._credit_exposure() > partner.credit_limit):
                raise UserError(_("Credit limit exceeded: send %s to finance for approval.", order.name))
        return super().action_confirm()

In production I replace the error with a proper Request credit approval button and an approval state, but the check itself stays this simple.

Practical rules that keep sales happy

  • Overdue beats limit. Many clients also hold orders when an invoice is overdue by more than N days, even if the customer is under the limit.
  • Exempt prepaid orders. If the payment term is immediate or the order is paid in advance, skip the check.
  • Review limits regularly. A list view of customers with limit, exposure and usage % makes the monthly credit meeting take ten minutes.
  • Log everything. Approvals tracked in the chatter answer the auditor's questions before they are asked.

Conclusion

Use the standard warning to inform, and add a hold-and-approve step to control. With exposure computed correctly, credit limits stop being a number on a form and start protecting your cash flow. Need this in your Odoo? Get in touch.

You've reached the endFound it useful? Share it with your team.
Topics #Accounting#Approvals#Odoo 19#Sales
Share
Gautam Kundaria
Written by

Gautam Kundaria

Odoo Techno-Functional Consultant with 5+ years of implementing, migrating and customising Odoo for businesses worldwide.

Planning to do this in your Odoo?

I implement, customise and support Odoo for growing businesses. Tell me what you need and I will reply within 24 hours.

Chat on WhatsApp