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?
The question has been closed for reason: not relevant or out datedby
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
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.
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.
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.
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?
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 -
customer is "Fred Blogs" who works for "Smiths Industries" this person has 0 Credit
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