Auto-Creation of Material Request based on Reorder Level and Reorder Qty

Dear All,
I want to know the what is the time and frequency of auto-creation of Material Request based on reorder level and reorder qty.

Also, is there any way to change the time and frequency of the same.

Regards
Ruchin Sharma

Hi Ruchin,
I recently had the same question and searched around quiet a bit.
The auto-creation is currently done once a day.
I changed the frequency by modifying the hooks.py file.
Just find the following line:
“erpnext.stock.reorder_item.reorder_item”
This line is currently in “daily”. You can cut and paste it under “hourly” or create a new line “all” which corresponds to every 3 minutes.
Hope this helps.

2 Likes

@creador are you sure there is now way to set this up from inside the GUI without having to actually write code?

You need to change in hooks.py only, no UI for this.

Thanks @nabinhait @creador @vrms

will such change (moving the “erpnext.stock.reorder_item.reorder_item” line from the “daily” to the “hourly” section of the hooks.py file) survive an update?

as far as I understand the matter the update is done through git (I assume the bench command somehow triggers a git pull or so). And if I am not wrong about how git works (which could easily be so, because I don’t know all too much about it) it creates a conflict once you change any of your local files and then try to to update it (git pull from the remote).

You should not change any code directly in the erpnext repository. With update, it can break or conflict.

Whenever you need a change in the code, you should create a separate app to do that. In this case, you should create a separate app and in it’s hooks.py, call reorder_level in hourly basis.

thanks for clarifying. That’s more or less what I thought. In this case (changing a setting) I would think it should be possible to do that without writing a new app.

second thought … @ruchin78 makes now a new app just to change the frequency of the Material Request auto-creation. How would it be possible for anyone else who might have the same need to use that code? This again points at the question where such small (or big) developments can be shared among community members? I think the easiest would be that @ruchin78 posts the github repository he might create for this app. Going deeper into this matter I think there needs to be centralized location for sharing apps.

1 Like