sale_credit_limit by Alexis de Lattre

In my opinion the available credit limit is:
+ credit limit defined in the customer master
- Partner's credit (considering total open AR / AP items)
- Open order lines (not invoiced)
- Open customer invoices
+ Open customer refunds

This would constitute a static credit limit check, and you can see it implemented in https://github.com/OCA/sale-financial/pull/9

A dynamic credit limit check would be a bit more complex, because it would only take into account the open orders up to a certain time horizon (for example, do not include in the credit limit check orders that are created, that would be delivered in X months).