How to Pass argument to doc_event in hook
“on_submit”: [“custome.update_stock”],
def update_stock(doc,method):
if method=‘add’:
some code
else:
some code
How to Pass argument to doc_event in hook
“on_submit”: [“custome.update_stock”],
def update_stock(doc,method):
if method=‘add’:
some code
else:
some code
Can you describe your use case?
Because it is not possible to pass an argument.
and method is hook’s method like before_save
and on_submit
etc.
Instead you can create a wrapper function and call your actual function with arguments.