Method in controller not get called

hello, i m making call to method in controller from js below is my js code:

frappe.ui.form.on("Employee", {
    onload: function(frm) {
	frappe.msgprint("script called");
       frappe.call({
	"method": "employee.employee.generate_code",
	callback:function(r){
	frappe.msgprint("method Called");
	console.log("value is");
	cur_frm.set_value("emp_no",j);}
	});

}
});

and below is my code for employee.py

from __future__ import unicode_literals
import frappe
from frappe.model.document import Document

class Employee(Document):
	pass

@frappe.whitelist
def generate_document():
	j=frappe.db.sql("""SELECT Count(*) FROM tabEmployee""")
	frappe.msgprint("Number of employees are "+j+" in db")
	return j;

but i am not receiving any message-dialog from method and console message.any help will be appreciated.

Thanks,
Hardik

Any error? Share the traceback

Seems there is an issue in the path, kindly check the entered path is correct.

@rohit_w can u please give general format for calling method.

Hi @Hardik_Mehta,

The format you have used is correct but I think method’s path is not correct, for more details check below example

JS code

###PY code