Help

How can I activate a credit limit for my customers?

Closed

The question has been closed for reason: not relevant or out dated

by
Frédéric Gilson (fgi)
on 03/25/2019 05:15:19

In the contact form, I notice a field named "Credit limit" in the Accounting tab. But if I set a value, nothing happens when I override this limit during a sale operation? How can I set up a blocking mechanism in the sales order validation?

Avatar
Discard
6 Answers
13
Best Answer

You need to add a condition in the first transitions of the sales workflow: i.e. Credit limit > Total receivable (the amount the customer owes you) + Amount of the new SO.

So open the sales workflow (either from the developer drop-down menu, or from Settings > Technical > Workflows > Workflows). Then, add the following condition in the two order_confirm transitions (between draft & sent to router nodes): partner_id.credit_limit > partner_id.credit + amount_total (replacing True). Use the Diagram view to find them in an easier way.

From now on, everytime you try to validate a sales order, the SO status remains on "Quotation" if the sum of the amount the customer owes you and the new SO amount is higher than his credit limit.

5 Comments
Avatar
Discard
Avatar
my
-

Thank you, it works fine. However, I have another question, where you can help me one probably again. Is it possible, if so allow, show how a notification, if the credit limit is not sufficient for the job? Something like: The credit limit is not enough.

Thank you again.

Avatar
Houssine BAKKALI
-

another way to do it if you do want to modify your workflow through the interface is to override the function action_button_confirm cause this is this function that is raising the signal defined in the transitions

Avatar
Josh Stover
-

To take this further, I would like the ability to override the credit hold with management approval. So if a customer was over their limit and the order was blocked, the system would throw a warning rather than just blocking it from being confirmed all-together. There are circumstances where a check was lost in the mail, or an invoice was missed being sent, etc, where it is not entirely the customers fault that they are over the limit and in those circumstances, with management approval, orders are still filled that are over a customer's credit limit.

Avatar
Sean Samborski
-

Is it possible to have an alert or popup display a message to the user? This method works to block the progression of the sales order when a user presses "Confirm Sale" but it just refreshes the page without any message. The user will probably just click the button and then not notice nothing actually happened.

Avatar
Marcio Valenzuela
-

Great, works for us. How do I add the popup message that Josh asked about?

1
Best Answer

In the "Getting Started with OpenERP" chapter of the V7 documentation I found the following statement:

"if one of your accountants puts a customer on credit hold, then that will immediately block any other action related to that company’s credit (such as sales or delivery)."

To test that I putted a credit limit of "0" to a customer. But I still can create and confirm a sales order, deliver goods and create and validate an invoice for this customer. Why is that?

1 Comment
Avatar
Discard
Avatar
my
-

Hi Robert. Have you added the code of Fredeic Gilson? This code works fine. Make sure you that you have the code correctly. Greeting.

0
Avatar
Mustufa Rangwala
Best Answer

Hello,

Please see this video https://youtu.be/mkwVzN9NQrE

Regards,

Probuse Consulting Service Pvt Ltd


Avatar
Discard
0
Best Answer

Hi i have try it, it's work, but nothing reminder dialog open, so how to add it ?

Odoo 8

Avatar
Discard
0
Avatar
Cameron
Best Answer

Many thanks Frederic, however I changed the formula slightly to

"partner_invoice_id.credit_limit > partner_invoice_id.credit + amount_total"

Reason is we give give credit to the company not each employee of that company! We use OpenERP this way - Sales>Sales>Quotations> Create

The customer is "Fred Blogs" who works for "Smiths Industries" this person has 0 Credit The Invoice Address is "Smiths Industries" who has a credit of XXX GBP

This way we track who placed the order and can communicate with that individual, but all invoices go the company

2 Comments
Avatar
Discard
Avatar
Cameron
-

Just improved the formula (now allows for a path to create a proforma invoice - ie "create invoice = before delivery") new formula including brackets is (order_policy=='prepaid') or (partner_invoice_id.credit_limit > partner_invoice_id.credit + amount_total)

Avatar
Marcio Valenzuela
-

Im not sure I follow why you made the change from partner_id.credit_limit to partner_invoice_id.credit_limit

0
Avatar
my
Best Answer

Sorry, but where can I find these two 'orderconfirm' transitions? I mean, what name they have exactly? I'm unfortunately not quite sure what these are.

Thank you.

1 Comment
Avatar
Discard
Avatar
Marcio Valenzuela
-

Settings > Workflows > Transitions > draft - router - order_confirm sent - router - order_confirm