I was generating Items from Variants, but got an error saying the name was over 140 characters.
I changed the characters of the abbreviations to be smaller, retried but now I get this error:
Traceback (most recent call last):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 554, in db_insert
frappe.db.sql(
File “/home/erpnext/frappe-bench/apps/frappe/frappe/database/database.py”, line 227, in sql
self._cursor.execute(query, values)
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 153, in execute
result = self._query(query)
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 322, in _query
conn.query(q)
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 563, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 825, in _read_query_result
result.read()
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 1199, in read
first_packet = self.connection._read_packet()
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_packet
packet.raise_for_error()
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, “Duplicate entry ‘STO-ITEM-2024-00099-n/Acc-n/PM-n/CRM-n/HR-n/Manu-n/Inv-n/Flee…’ for key ‘PRIMARY’”)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py”, line 1428, in perform_job
rv = job.perform()
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/rq/job.py”, line 1278, in perform
self._result = self._execute()
File “/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/rq/job.py”, line 1315, in _execute
result = self.func(*self.args, **self.kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 221, in execute_job
retval = method(**kwargs)
File “/home/erpnext/frappe-bench/apps/erpnext/erpnext/controllers/item_variant.py”, line 265, in create_multiple_variants
variant.save()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 337, in save
return self._save(*args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 359, in _save
return self.insert()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 302, in insert
self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 581, in db_insert
raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: (‘Item’, ‘STO-ITEM-2024-00099-n/Acc-n/PM-n/CRM-n/HR-n/Manu-n/Inv-n/Fleets-n/Geos’, IntegrityError(1062, “Duplicate entry ‘STO-ITEM-2024-00099-n/Acc-n/PM-n/CRM-n/HR-n/Manu-n/Inv-n/Flee…’ for key ‘PRIMARY’”))
I checked the Database and there is no data with those names. So I don’t know why it keeps saying it is duplicated.
My install is Manual.
ERPNext: v15.37.0 (version-15)
Frappe Framework: v15.43.0 (version-15)
Please Help!