Problem in creating a hook

I have created hook in the following way…( For Sales Order)
I have created new python script “custom_hook.py” in the "sales_order " doctype folder and i have created hook in “hooks.py

Following is my code in " custom_hook.py"

i am getting following error in calling my hook

Traceback (most recent call last):
File “/home/jithendra/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/jithendra/frappe-bench/apps/frappe/frappe/handler.py”, line 42, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/jithendra/frappe-bench/apps/frappe/frappe/init.py”, line 903, in call
return fn(*args, **newargs)
File “/home/jithendra/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 735, in submit
self._submit()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 724, in _submit
self.save()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
return self._save(*args, **kwargs)
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 281, in _save
self.run_post_save_methods()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 787, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 663, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 881, in composer
hooks.append(frappe.get_attr(handler))
File “/home/jithendra/frappe-bench/apps/frappe/frappe/init.py”, line 883, in get_attr
return getattr(get_module(modulename), methodname)
AttributeError: ‘module’ object has no attribute ‘calculate_taxes’

What else i am missing out here.

@jithendra,

calculate_taxes is a class method and can not be called without creating class object.
instead of class method define your method out side of class.

Thanks,
Makarand

Thank You @makarand_b for the suggestion.
Issue has been Solved.