the only thing I can think of, is really a problem with the path.
If you try to import that in bench console, do you get the same error?
the scripts directory is in the same emplacement as hook.py?
*note: usually people write hooks methods in custom_app.events.py directly. I don’t think it’s part of the issue, I’m just saying it might be a good practice.
the scripts directory is in the same emplacement as hook.py?
yes i tried also app_name/module_name/script.py, an app_name/my_dir_name/script.py
*note: usually people write hooks methods in custom_app.events.py directly. I don’t think it’s part of the issue, I’m just saying it might be a good practice.
Thanks for recommendation. Yes i know that, but when i have lot of hooks i want have it splitted to more files.
But i tried this now: when i add all hooks to one file for example events.py, and this file is placed inside same directory as hooks.py, it is working, bow when i put it inside another folder then this hook is not working.
For now my fix is do it in this way. But i want solve this in future, because it is very risky whnen dev enviroment working different than production.
Well you found the problem: a method called from the hook should never be in a new directory. You need to place it with a doctype (where you have the files .py/.js) or in the same hierarchy as hook.py
I didn’t notice you had a new folder for it. ERPNext doesn’t like that, I don’t know why…
The fact that vagrant let it pass is weird