Unable to call hooks method

Hi everyone,

I am trying to call a method from hooks.py as like below.

In hooks.py(calling on save)

doc_events = {
    "Quotation": {
        "on_update": "app_name.hooks_call.quotation.update_quantity"

In hooks_call

from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cstr, cint
from frappe import msgprint, _

def update_quantity(self):

The message is not getting printed after clicking on save button.

Am I missing anything in the hooks.py?


Your function must receive the doc and method params. Also make sure that hooks_call have an __init__.py file:

def update_quantity(doc, method):


after passing method, still that message is not displaying

def update_quantity(self,method):

__init__.py file is exist in hooks_call folder

Any other changes needs to be done

The console shows an error when you click on the save button? Can you check that?


There are no errors in the browser console on click of save button.

You must clear cache after changing hooks

I ran these commands and restarted bench but my message is not getting printed.

bench --site [sitename] clear-website-cache
bench --site all clear-website-cache