I’m looking for a way to automatically import my sales orders from a remote csv file. If any of you know the procedure to follow, I would very much like him to send me the exact procedure, please
Hello! A Data Import tool/feature exists in Frappe/ERPNext but your csv file needs to follow a specific format for it to work.
More on this here: https://erpnext.org/docs/user/manual/en/setting-up/data/data-import
Cheers
Thank you for your quick response, but I would like the automatic evening import every hour. I have seen a lot of post on HOOKS.PY, CRONTAB and API but there is no explicit tutorial on it.
@YannCoppryDigital, do you have a python code which reads the csv file and then imports it into a sales order? If anything you’ll need to:
- Create a python file (in your app) which will read the csv file and import it into a sales order.
- Create a “Scheduled Task” OR a cronjob (pick one.). Both can be added to hooks.py. EG: If you want to add an “hourly” event, you can do something like this:
scheduler_events = {
"hourly": [
"the_name_of_the_custom_app.the_python_file.the_name_of_the_function",
"example_app.folder_name.folder_name.the_python_file.function2"
],
…of course, for a cron job, it’ll be something different.
- Restart bench. Check if it runs.
Thank you @littlehera for these lights, it will help me a lot
Can you guide me on creating the pyhton file that should read the CSV file? I will be very grateful to you
Yes its quite available and doable, please read the docs, online help, check a youtube video, search the forum and inform yourself. Let us know when you get stuck.
Hi,
Could you share any link to an example of a script in docs, online help or youtube ?