Where to add Python functions for scheduled tasks

25 views
Skip to first unread message

Chris Horton

unread,
Jun 12, 2014, 2:01:26 PM6/12/14
to erpnext-dev...@googlegroups.com
I am following the Developer Guide tutorial and am at the last section (8. Tasks). The tutorial says how to add a task handler in hooks.py for the library_management application, but it also shows the Python code for the scheduled task without mentioning where this function should be placed.

Where should the function shown in the tutorial be placed?

Thanks,
Chris

Rushabh Mehta

unread,
Jun 12, 2014, 2:07:04 PM6/12/14
to erpnext-dev...@googlegroups.com
Could be anywhere you like as long as it is accessible as a Python module. The route is defined in hooks.py

In this case, the function "library_management.tasks.daily" would be in libarary_management/tasks.py



--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2f9cc7e7-6524-4949-8d52-bdd565e54f25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Horton

unread,
Jun 12, 2014, 2:11:19 PM6/12/14
to erpnext-dev...@googlegroups.com
That's what I initially thought, but I just wanted to make sure. Thanks for the help!


On Thursday, June 12, 2014 2:07:04 PM UTC-4, rushabh wrote:
Could be anywhere you like as long as it is accessible as a Python module. The route is defined in hooks.py

In this case, the function "library_management.tasks.daily" would be in libarary_management/tasks.py



On 12-Jun-2014, at 11:31 pm, Chris Horton <chris...@thedrainage.com> wrote:

I am following the Developer Guide tutorial and am at the last section (8. Tasks). The tutorial says how to add a task handler in hooks.py for the library_management application, but it also shows the Python code for the scheduled task without mentioning where this function should be placed.

Where should the function shown in the tutorial be placed?

Thanks,
Chris

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages