i have created a custom fields in project doctype.
Succefully added fixtures in my custom app
Now i m writting the py file to validate this custom field .
hooks.py file is here:
still i m not able to get expected output.
Is my syntax in py and hooks file is right?
can someone help me on dis?
Add print statement or simple
frappe.msgprint() in your method to get to know whether your function is callable or not.
One more thing, remove line -
doc.save() as your calling your method on validate.
i have tried below line in abcd function
did bench restart.
still not getting expected output.
Seems like your path is incorrect then.
run bench console from frappe-bench dir. and try to import your method.
But if your path is incorrect it will give you error
i have tried.it is accepting.
what is the error sir?
I m not able to get expected output.
try your method,
from overtime.overtime.project_custom import abcd
So, you are updating stock_entry_consumable field form project on save.
def abcd(doc, method):
doc.stock_entry_consumable = 100
and save any project record, you will see this message pop-up. Also, make sure your filed-name is correct.