Could not find Voucher No: XXXX

i already have material request on screenshot 1 (sorry I can’t post a picture so I attached it to the drive)

and i wan to create stock entry but got error could not find voucher no: xxx when i save it

I have tried debugging the error in the function _validate_links on apps/frappe/frappe/model/document.py

and on this code:

if not fields_to_fetch:
	# cache a single value type
	values = _dict(name=frappe.db.get_value(doctype, docname, "name", cache=True))

i got values: {'name': None} with doctype: Stock Entry and docname: MAT-STE-2024-12434

i used erpnext version 14

Is there a clue, friends?
Thankyou

We checked the latest version, and it seems to be working properly.

I think the issue lies in your stock entry voucher number, which has been deleted. If you have it, please restore it, as it is linked to another document.

thankyou @NCP for your response.

I only had this problem in a few cases when I wanted to save. (but i’m not sure why)

| I think the issue lies in your stock entry voucher number, which has been deleted
I don’t think I ever deleted it, is there any documentation to recover/check the voucher number?

Copy the voucher number and check it in the Stock Entry. if deleted then check it in the deleted document doctype.

the voucher number on stock entry is always increment when i tried to save
ex:

  • MAT-STE-2024-12439
  • MAT-STE-2024-12440
  • MAT-STE-2024-12441
  • MAT-STE-2024-12442

Edited:

i will tried to add MAT-STE-2024-12444 on data stock entry when i got error voucher no MAT-STE-2024-12443 i got error
Stock Entry MAT-STE-2024-12444 already exists

but if I try to save it again, it runs normally and can be saved
i don’t know why @NCP

Update Series Counter.

Set here what is the last id number in the stock entry

i got temporary solution on this

thankyou @NCP for your help