i have a custom app called ‘ict’, i defined a new module ‘ICT’ and new doctype ‘outcome’.
I’m in developers_mode 1, the doctype is make from web interface.
The problem is under ict/ict/ict/doctype/outcome the js part (outcome.js) work fine but i don’t understand how to use outcome.py
I create this file:
this not work and i don’t understand
Thanks for your time
‘.py’ file is used to write your business logic. The validate method(trigger) that you have written is called when you create a new record under that doctype and save it.
First of all thanks for the answer, now I try to explain myself better.
My goal is to create my logic inside the .py file, but seams that it was not read. The .js files are automatically taken from, the python one no. That code was just a test to verify that it was used, but when I click save on the doctype outcome I don’t see anything.
What could be the problem?
Your code should throw error “Hello”.
Did you create your file .py manually?
Files should be created after you create Doctype without custom checked.
Nothing comes out, yes I created it manually, I also read that it had to be created automatically, but I did not do it, but the custom is checked.
I try to remove it and see what happens, I didn’t know this thing.
Thanks a lot!
Custom tick comes checked by default if your developer mode isn’t enabled.
First enable your developer mode,
- Go to frappe-bench/sites/your_site folder
- Open site_config.json
- Append, “developer_mode”: 1 in the json file
- Stop your setup and hit the command ‘bench migrate && bench clear-cache && bench build’
- After the execution of that command, start your setup and go for doctype creation.
Now you can remove the custom tick and save your doctype.
The folder and files will be created automatically. Then you can proceed further.