Error while creating a custom app

i have created custom fields for attendance doctype

i want to write script for calculations in a custom app.
so i have written a code in attendance_custom.py

and also included functions in hooks.py file of my custom app but i’m getting internal server error…is the code correct?

Overtime should be standard feature no? :thinking:

1 Like

We are new in Frappe Framework.
:slight_smile: :slight_smile:
We have ready feature available in ERPNext that is TimeSheet. its very good,
but we have created a custom fields in attendance Doctype with Over Time Hours and IN OUT Time :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: , we have already done with the changes but,all changes we have made is into ERPNext not in custom Apps.

So now we are trying to add those changes in Custom App. We will also contribue to the ERPNext.

Thank you.

Send in a PR, get it merged, use it again!

1 Like

Look for an error traceback listed in your logs and post it here

File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 809, in load_app_hooks
app_hooks = get_module(app + “.hooks”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 700, in get_module
return importlib.import_module(modulename)
File “/usr/lib64/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/frappe/frappe-bench/apps/overtime/overtime/hooks.py”, line 84
doc_events = {
^
IndentationError: unexpected indent

Remove any spaces before the statement. Python is based on indentation, so it wont work if there are unnecessary spaces.

1 Like