When i am trying to add payroll i got error?

App Versions

{
	"ecommerce_integrations": "1.12.0",
	"employeewise_payroll": "0.0.1",
	"erpnext": "14.2.3",
	"frappe": "14.10.0",
	"hrms": "1.0.0",
	"payments": "0.0.1"
}

Route

Form/Payroll Entry/HR-PRUN-2022-00001

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1585, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/load.py", line 37, in getdoc
    doc = frappe.get_doc(doctype, name)
  File "apps/frappe/frappe/__init__.py", line 1180, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 72, in get_doc
    controller = get_controller(doctype)
  File "apps/frappe/frappe/model/base_document.py", line 81, in get_controller
    site_controllers[doctype] = _get_controller()
  File "apps/frappe/frappe/model/base_document.py", line 59, in _get_controller
    module = frappe.get_module(module_path)
  File "apps/frappe/frappe/__init__.py", line 1323, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "apps/employeewise_payroll/employeewise_payroll/employeewise_payroll/payroll_entry/__init__.py", line 1, in <module>
    from .payroll_entry import CustomPayrollEntry, cash_payment, payroll_payment_entry_exists
  File "apps/employeewise_payroll/employeewise_payroll/employeewise_payroll/payroll_entry/payroll_entry.py", line 3, in <module>
    from erpnext.payroll.doctype.payroll_entry.payroll_entry import PayrollEntry
ModuleNotFoundError: No module named 'erpnext.payroll'

Request Data

{
	"type": "GET",
	"args": {
		"doctype": "Payroll Entry",
		"name": "HR-PRUN-2022-00001"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.load.getdoc"
}

Response Data

{
	"exception": "ModuleNotFoundError: No module named 'erpnext.payroll'"
}

What’s the app source?

Looks like this isn’t compatible with version 14 as hrms app and flows were split from ERPNext.

I am getting this from GitHub.(GitHub - open-alt/employeewise_payroll: Make employee-wise Journal Entry for payroll entry).

Dependencies state the app needs a minimum level of v13:

Looks like it is untested with v14. Changes need to be made to point to hrms app and not ERPNext for payroll and other HR functions.

Best to get in touch with the developer and confirm these. You can start by creating an issue on the app repo.

Yes, That’s true.

I will try to adopt it and test on version-14 on these two weeks, Insha’Allah.

Updated to work with version-14

1 Like

hi after update i got new error when i am create salary slip.
it’s can’t import PayroolEntry from employeewisee_payroll.hooks.
Failed to get method for command employeewise_payroll.employeewise_payroll.payroll_entry.payroll_payment_entry_exists with cannot import name ‘PayrollEntry’ from ‘employeewise_payroll.hooks’

be sure to install it after installing hrms
Maybe you can trying to uninstall the app and reinstall it.
Maybe this will solve the problem?

ohk let me try it…Thank You

App Versions

{
	"ecommerce_integrations": "1.12.1",
	"employeewise_payroll": "0.0.1",
	"erpnext": "14.5.0",
	"frappe": "14.14.0",
	"hrms": "1.0.0",
	"payments": "0.0.1"
}

Route

Workspaces/Payroll

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/utils/caching.py", line 55, in wrapper
    return frappe.local.request_cache[func][args_key]
KeyError: -8346819987879983498

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1585, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/load.py", line 72, in getdoctype
    docs = get_meta_bundle(doctype)
  File "apps/frappe/frappe/desk/form/load.py", line 83, in get_meta_bundle
    bundle = [frappe.desk.form.meta.get_meta(doctype)]
  File "apps/frappe/frappe/desk/form/meta.py", line 40, in get_meta
    meta = FormMeta(doctype)
  File "apps/frappe/frappe/desk/form/meta.py", line 54, in __init__
    self.load_assets()
  File "apps/frappe/frappe/desk/form/meta.py", line 64, in load_assets
    self.add_code()
  File "apps/frappe/frappe/desk/form/meta.py", line 115, in add_code
    self.add_code_via_hook("doctype_js", "__js")
  File "apps/frappe/frappe/desk/form/meta.py", line 140, in add_code_via_hook
    for path in get_code_files_via_hooks(hook, self.name):
  File "apps/frappe/frappe/desk/form/meta.py", line 267, in get_code_files_via_hooks
    code_hook = frappe.get_hooks(hook, default={}, app_name=app_name)
  File "apps/frappe/frappe/__init__.py", line 1471, in get_hooks
    hooks = _dict(_load_app_hooks(app_name))
  File "apps/frappe/frappe/utils/caching.py", line 57, in wrapper
    return_val = func(*args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 1445, in _load_app_hooks
    app_hooks = get_module(f"{app}.hooks")
  File "apps/frappe/frappe/__init__.py", line 1323, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "apps/employeewise_payroll/employeewise_payroll/hooks.py", line 3, in <module>
    PayrollEntry = get_controller("Payroll Entry")
  File "apps/frappe/frappe/model/base_document.py", line 81, in get_controller
    site_controllers[doctype] = _get_controller()
  File "apps/frappe/frappe/model/base_document.py", line 59, in _get_controller
    module = frappe.get_module(module_path)
  File "apps/frappe/frappe/__init__.py", line 1323, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "apps/employeewise_payroll/employeewise_payroll/employeewise_payroll/payroll_entry/__init__.py", line 1, in <module>
    from .payroll_entry import CustomPayrollEntry, cash_payment, payroll_payment_entry_exists
  File "apps/employeewise_payroll/employeewise_payroll/employeewise_payroll/payroll_entry/payroll_entry.py", line 3, in <module>
    from employeewise_payroll.hooks import PayrollEntry
ImportError: cannot import name 'PayrollEntry' from partially initialized module 'employeewise_payroll.hooks' (most likely due to a circular import) (apps/employeewise_payroll/employeewise_payroll/hooks.py)

Request Data

{
	"type": "GET",
	"args": {
		"doctype": "Salary Slip",
		"with_parent": 1,
		"cached_timestamp": null
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.load.getdoctype"
}

Response Data

{
	"exception": "ImportError: cannot import name 'PayrollEntry' from partially initialized module 'employeewise_payroll.hooks' (most likely due to a circular import) (apps/employeewise_payroll/employeewise_payroll/hooks.py)"
}

Hi
I got the same error after installing with V13.26
cannot import name ‘PayrollEntry’ from partially initialized module ‘employeewise_payroll.hooks’ (most likely due to a circular import)

I am using ERPNext 13.26. I did many changes to DocTypes, including the Payroll Entry.
after installing the employeewise_payroll , the site is not opening “cannot import name ‘PayrollEntry’ from partially initialized module ‘employeewise_payroll.hooks’ (most likely due to a circular import)”

I tried

bench-restart
not working
then
sudo service nginx restart
sudo supervisorctl restart all
site is working back now

1 Like

my site is in work but how to use empwise payroll can u suggest.

other option like we use 13 v then upgrade it into 14 then it will work or not?