Training Event doesn't allow duplicates even without any unique field

As the title says, I don’t have any unique field but the event_name field is treated as primary/unique internally in the DB apparently.

I get this stacktrace if I try to import such entries:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 325, in db_insert
    ), list(d.values()))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/", line 156, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 170, in execute
    result = self._query(query)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 328, in _query
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 517, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 732, in _read_query_result
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 1075, in read
    first_packet = self.connection._read_packet()
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 684, in _read_packet
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 220, in check_error
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry 'Interne Schulung' for key 'PRIMARY'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/", line 126, in import_data
    doc = self.process_doc(doc)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/", line 194, in process_doc
    return self.insert_record(doc)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/", line 213, in insert_record
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 248, in insert
    raise e
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 245, in insert
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 335, in db_insert
    raise frappe.DuplicateEntryError(self.doctype,, e)
frappe.exceptions.DuplicateEntryError: ('Training Event', 'Interne Schulung', IntegrityError(1062, "Duplicate entry 'Interne Schulung' for key 'PRIMARY'"))

What I want is to have non-unique names for Training Events. If a unique field is required: Can I automate this ? Like it’s done for Employees internally? I don’t want to force people adopting their own unique naming scheme when creating reoccurring events. Note also that according to Issue in Naming of Training Event. It should be based on Naming Series · Issue #8950 · frappe/erpnext · GitHub this shouldn’t happen ?

For anyone else with that problem:
Set event_name to hidden and add a default value.
Then add a custom script (client side JS) that takes the values of (for example) start_time + your event type and puts that as the value of event_name. In my case this is unique enough to work. When importing data you still have to create a CSV with unique event_name entries, as the custom script is client side and won’t run during import.

What does not work is trying to add a series to the document, as the event_name field is still required and can’t be “pre” populated from the naming series.

(You may be able to use a name series and populate the event_name field from that using some server side scripts, but I didn’t want to dig any further.)