How do I change the default flow of Purchasing?

So by default, when I create a Purchase Order, I then have to create a Purchase Receipt for the order, and then a Purchase Invoice. I would like to know if there is any way to automate the process in a way that I only create the Purchase Order, and the Receipt and Invoice are automatically done for that order.

I checked the settings and couldn’t figure out if such an option to change default flow of purchase/sell cycles exist. If there’s a way to do it with code, any guidance would be appreciated on which modules I have to edit and how. I do have coding experience, just no clue about how Frappe apps or ERPNext is structured and works.


Bumpitty Bump :slight_smile:

This almost sound like you are looking for a way (for example) to go the local hardware store and buy a hammer and then do a purchase cycle for it.

Unfortunately there is no shortcut through the process. However, please understand, the was designed to easily accommodate the typical purchasing cycle for larger businesses that would normally order wholesale quantities or have repeat orders for the same items.

In the “normal” cycle of a purchase in business, there would be the ordering phase where the person responsible for the purchasing places an order with the vendor. Usually a copy of your PO is sent to the vendor to start this process and the vendor replies with an expected delivery date (which is them added to the PO).

Now that the Purchase ORder is in the system, the system itself can alert the purchasing agent when they have NOT received the items purchased by the expected date. When a purchasing department is making hundreds of purchases a week, this becomes an important part of staying on top of the process. The automated alerts are a huge aid.

When the Items purchased are received at the receiving dock, the clerk matches the PO# on the vendors shipping label to the same PO in the ERP system and marks the items as received (either in full or partial). If the items were received in full then the purchase receipt triggers purchase invoice to be paid.

If the items are not received in full, the purchase receipt triggers the purchase agent to inquire about the remaining portion of the order.

By using all of the elements of the purchasing cycle it becomes easy to track which vendors are good and which are not always delivering as promised. That can lead to much more efficient operation of your business when you can increase the reliability of your supply chain.

So, in short, if you want to go to the store and buy a hammer, then just follow the process (even if it seems cumbersome at the time) in order to keep your business records clean. The extra minute or two to do the paperwork is worth it to your business in the long run.

Just my opinion, and as always…

Your mileage may vary! :sunglasses:


1 Like

Thank you for the detailed write up and explanation. I have gone through the ERPNext User Manual and figured pretty much the normal Purchase cycle would work like you have illustrated. The issue at hand is, I have a relatively small business where I have a warehouse that manufactures and stores products/items for me, and a couple of branches which make the sales of those manufactured items.

So my cycle goes something like this: I have a sales manager per shop on each branch; when they run low on some item’s stock, they put in a Purchase Order. But because the warehouse is also owned by us, it’s a guaranteed purchase and is usually handled through a call anyway. So the sales manager makes the PO, then creates the Purchase Receipt for that order, and finally creates a Purchase Invoice. There’s no input from the warehouse to the cycle, as it is all handled by the branches’ sales managers.

I understand the logic behind the default workflows and can appreciate why they are designed that way. But I have been going through the code for a while now and am wondering if there’s just some way, maybe through some api calls or some controller method called through the on_submit of the Purchase Order class. Unfortunately haven’t figured out how I would go about doing something like this.

But it is not just this Purchase cycle that I would have liked to customize for my business. I am also looking to learn how to better adapt the whole system for my employees and was hoping someone would chime in saying “Oh that’s easy, you just need to make these api calls with these parameters; here’s how to do it”. And then I could use that as a starting point to work on other parts of ERPNext, too.

Maybe wishful thinking, but I am just hoping to learn the system and will take in all the help I can get. I am also following the App Development guides for Frappe, and have noticed some differences in how ERPNext has been developed to the guides, so I am having a hard time wrapping my head around the two.

Anyways, sorry if it looks like a rant, but yea I am looking to better understand how to customize the app for my business needs and need some pointers for getting started.

Again, appreciate the feedback. Thanks.

In the short term, you could simply make a “Sales Invoice” to sell the items from one warehouse to another. It is a single document that closes all the holes and updates the general ledger.

If each location has it’s own cost center then you have the ability to use the sales path instead of purchase pathway.

Again, just a thought…


Simple material transfers are even easier and also require only a single document!!