Not able to add new employees, Showing employee number is already exist

Hi,
I was trying to add new employees. But it always shows like Employee EMP0001 is already exist. I am not able add new employees.

Here i am attaching the screenshot of the error getting.
Please help me to solve this.

Thanks and regards

Hello @rajeeb,
Can you please share the version of erpnext and frappe?
Does this occur everytime when you create a new employee?

Thanks & Regards,
Kalpit

@Shah_Kalpit Yes it occurs every time only for this series (EMP.####). Version is ERPNext: v11.1.33 Frappe Framework: v11.1.30

It works fine in mine. Have you changed anything in it?

@Shah_Kalpit I have imported some employee data by excel with employee numbers (Eg : EMP0001, EMP0002, EMP0003ā€¦) which is in the same naming series.

Okay, Check tabSeries table in database and check the value of EMP.
You might have to update the number (count) of the employee in current field of tabSeries.
Check it out and revert back! @rajeeb

You can set it form naming series.
Search Naming Series in Awesomebar.
Select transaction, prefix and current value .

Then click on update series number
it will be fixed

2 Likes

All of them are considering like indivdual

check with this

@winter_wolf i tried but iā€™m getting error

  Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 1032, in call
    return fn(*args, **newargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 84, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/run_method.py", line 36, in runserverobj
    r = doc.run_method(method)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/setup/doctype/naming_series/naming_series.py", line 162, in update_series_start
    (self.current_value, prefix))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py", line 199, in sql
    self._cursor.execute(query, values)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 517, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 732, in _read_query_result
    result.read()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1075, in read
    first_packet = self.connection._read_packet()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 684, in _read_packet
    packet.check_error()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
IntegrityError: (1048, u"Column 'current' cannot be null")

This is something which has gone wrong (Individual).

While creating new Employee, there is a Series which contains EMP.#### in yours. This needs to be changed.
It should be EMP (Select Option Value) in it.

Can you please describe what have you done in brief? @rajeeb

@Shah_Kalpit I wanted to import the list of employees with employee number which i already have. So i imported all employees using an excel sheet. When i added Employee number is coming like EMP00050001,EMP00060002,EMP00060002ā€¦ ( means collaborating with naming series ). So i removed EMP.#### naming series and imported data again. Then it came like EMP00050001,EMP00060001,EMP00060001ā€¦ Finally i renamed all employees from EMP00050001 to EMP0005. This is what i have done.

@winter_wolf Yes it worked for me. Thanks a lot.

1 Like

@rajeeb Okay, Great!

Glad you got the solution :slight_smile:

1 Like