I’m having an issue with my production server where I cannot create new Material Request documents. I had this issue previously with Supplier Quotations and Purchase Orders. I think the issue started when we transitioned to v7.
The issue is that there is already a document with the name already assigned. I’m not sure how Frappe picks a new document name, but it seems to be grabbing a bad one.
The way I’ve resolved it in the past is by cancelling and deleting the conflicting document, then recreating it. For some of the documents, I’ve had to cancel multiple ones.
With the material requests, they are linked to several documents so I can’t easily do this.
Any suggestions?
Here is a video showing the issue:
Traceback:
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 242, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in _save
self.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 223, in insert
self.db_insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 284, in db_insert
), d.values())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 137, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
DuplicateEntryError: (u’Material Request’, u’MREQ-01769’, IntegrityError(1062, “Duplicate entry ‘MREQ-01769’ for key ‘PRIMARY’”))