Yes i know sir but i just want to make entry in loan if user click apply_for_loan Button. i do not want to show loan page to user. Thats why i m doing in this way sir.
Great. Please acquaint yourself with the erpnext directory structure. It is the same in most cases.
Also, I suggest that you donât directly edit the source files - I understand that you have added this function in the original employee.py. Right now it may seem easy, but later when you to update, it will lead to conflicts. It is advisable you keep your functions in another custom app.
Also, same goes for doctypes - if you wish to add a new field to a default doctype, then use Customize Form not Edit Doctype. Also export these fixtures to your own app. Please read up about fixtures and custom app on this forum and you will get replies for any questions that come up.
OK Sir i will try to avoid making any changes in core files.
But Sir can i ask you that, if i want very small changes in any existing doc-type then crating a new doc or app would be long process.
Thatâs why i did in this way.
You can do one thing. Make one Python file. Write your function say make_loan_entry there (and yes it should be whitelisted via @frappe.whitelist() ) and use it. In this case , you donât touch the original file and you get your function. Depending on the number of functions you write you may later move on to multiple files say modulewise.
Also, youâll have to change the path since then the function is now in a different file.
Also, each time you update, be careful that this file is not deleted.