Sales Invoice error Log -unable to identify cause

Every most often i get the following error log generated in my error log list and cant verify the cause.

Traceback (most recent call last):
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/”, line 485, in submit_invoice
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 831, in submit
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 820, in _submit
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 256, in save
return*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 307, in save
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 890, in run_post_save_methods
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/”, line 132, in on_submit
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/”, line 606, in make_gl_entries
update_gl_entries_after(self.posting_date, self.posting_time, warehouses, items)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/controllers/”, line 349, in update_gl_entries_after
voucher_obj = frappe.get_doc(voucher_type, voucher_no)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 638, in get_doc
return frappe.model.document.get_doc(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 68, in get_doc
return controller(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/”, line 31, in init
super(SalesInvoice, self).init(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/controllers/”, line 19, in init
super(AccountsController, self).init(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 103, in init
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/”, line 140, in load_from_db
(“{0} {1} not found”).format(
(self.doctype),, frappe.DoesNotExistError)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 309, in msgprint
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 282, in _raise_exception
raise raise_exception(encode(msg))
DoesNotExistError: Sales Invoice SINV-07574 not found

But when checked later , the invoices are present in system …but some are missing or saved as different invoice number.
I know it might be a POS error as there are many ,
just wanted to confirm if there is anything that is done on client side while making that is causing this(like some info not mentioned) or its from the system side…


The error is appearing while reporting future sales invoices, as you are making back dated POS/Sales Invoices. While doing reporting, system does not find some invoices whose reference is present in GL Entry.

For any reason are you deleting / modifying GL Entry manually directly from Mysql?

Hello @nabinhait,

Don’t know about back entry, just directly making invoices through pos, there isn’t any option to put date there…
And haven’t modified any gl entry manually,
The only thing i had deleted manually from sales invoice table was a sales invoice with a template item sold - had reported the problem

its not solved yet , but i am unsure that that is the cause of this…
Is there a way to check the invoices that are in back entry???
I have seen this back entry issue a couple of more times on forum.

Please advice,