Error while making a new Item

While making a new item, I got the following error -

Traceback (most recent call last):
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/handler.py", line 52, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/__init__.py", line 907, in call
    return fn(*args, **newargs)
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/client.py", line 124, in insert
    doc = frappe.get_doc(doc).insert()
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/document.py", line 187, in insert
    self.set_new_name()
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/document.py", line 333, in set_new_name
    set_new_name(self)
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/naming.py", line 38, in set_new_name
    doc.run_method("autoname")
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/document.py", line 666, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/document.py", line 892, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/document.py", line 875, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/pranavgoel25/frappe-bench/apps/frappe/frappe/model/document.py", line 660, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/pranavgoel25/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 44, in autoname
    elif not self.item_code:
AttributeError: 'Item' object has no attribute 'item_code'

@pranavgoel25,

Can not replicate did you made any customization in Item doctype?