In my erpnext 15 instance i have set to auto create Job card as soon as I submit the workorder. This works really well but i want to take this further. Currently Once the job card is created i have to manually open the job card > Click in start and save the job card. How can i automate so that as soon as the job card is created its gets started and saved?
Hi @Mite87
The Job cards are generally require to be scheduled and assigned to staff members to start on a particular date and time despite work order has been started some time earlier in the past as you may have multiple job cards within one of your work order.
Triggering them all at once is not serving any logic and all machining process requires to be run step by step under the umbrella of Routing.
Please write here for further understanding.
Hi @ahsantareen
We are very small company with limited human resources with basic technology knowledge. Majority of our workforce is labor. we dont assign the job card to any person instead its responsibility of the department. we have only 1 person to document 4 different process for each 4 department. there might be upto 10 job cards for each workorder. We have setup workflow with process names for job card status (total 8 processes) .
Right now the workflow we have is
Sales order > click create workorder > submit workorder > click Start work order > open each individual job card click save > click start > Click on action and select the current process name .
This is so many clicks for one person and specially when he will have to deal with minimum 60 job cards a day. So i want to minimize the clicks.
Ideal workflow will be
Sales order > click create workorder that will automatically submit the work order and start the workorder along with saving and starting all job cards associated with particular work order.
Hope this will help to understand our need.
@Mite87 then you should run work order without job cards. The BOM controls this thing.
Can you elaborate a little. I will look into BOM but little more guidance will help me a lot.
@Mite87 you can create BOMs WITH Operations or WITHOUT Operations. If you create BOMs WITHOUT Operations then Work Orders will be created WITHOUT Operations. When you subsequently submit these work orders NO job cards will be created. Now you will only need to complete the process for stock entries for Raw Materials that you have listed in the BOM.
You only need to create BOMs WITH Operations if you want to keep track of the actual time taken to make each Work Order Item and then based on that time an estimate of the machine running costs and labour costs.
A little advice from my Company’s journey. I too started this way of BOMs WITHOUT Operations because of apprehensions of senior staff. Then once senior staff became more comfortable, they started pushing me to keep track of operations so that they can get a more real time picture of each sales order (that can have over 100 items with over hundreds in qty of each), which meant keeping track of all the work orders and ultimately keeping track of each work order vide its job cards. However, this now meant updating thousands of BOMs which was a huge and painful task on its own and required lots of trial and error to translate/elaborate our processes to match that of ERPNext’s.
My view is if you have already taken the pain to manage Job Cards and it is working correctly to persevere with it. My present challenge is develop some custom client and server scripts from the Job Card listview, as many of my Job Cards need to be started and stopped in parrallel. I wish Frappe had developed this functionality as part of its core! Also, my goal is to push out the system to the labour force at each workstation so taht eventually they manage the job cards. Please do not under estimate labour - I have experienced the same at my Company and yet the same labour force in their accomodations are completing more tasks of personal interest to them with their mobile phones than possibly I could!
Good luck with your journey - a diificult one indeed if you are on your own, but a fulfilling one once things start coming togther…
Thank you for detailed explanation. I am the owner if this small company and am on my self to implement. I would agree on not underestimate labor strength. Before going to the workflow approach i have already played with operation part but it caused chaos in our work environment due to the nature of our industry where no labor person is fix neither the machine is fixed. After multiple failed attempts the workflow way is the one which i think is working little better for my small company. At this point my company is only struggling due to so many clicks to go to the next steps. Less clicks will mean less error chances. If i can figure out starting and clicking Finish for workorder and Jobcard as they are created that will save a lot of human hours for us with less errors.
We are still looking for the way to automatically start/finish/Save the job card if someone can help with scripting.
I have already tried server script with After submit/before submit but didnt work. Below is the code I tried.
Auto-save Job Card if it’s in “Not Saved” UI state
if doc.status == “Open” and doc.docstatus == 0:
frappe.msgprint(f"Auto-saving Job Card {doc.name}")
doc.flags.ignore_permissions = True
doc.save()
If anyone interested i was able to start the job card and save it using the Server script.
and with below steps :
- Go to Setup > Settings > Server Script
- Find your script for the Job Card’s
after_insertevent - Add below code :
Get the job card document
job_card = frappe.get_doc(‘Job Card’, doc.name)
Update the status and started time
job_card.status = ‘Work In Progress’
job_card.started_time = frappe.utils.now()Save the document (this will trigger all validations and events)
job_card.save(ignore_permissions=True)
