Hello guys, im trying to get warehouse inventory from an external API (physical data) and compare it to my ERPNext warehouse inventory levels and then do either opening stock if item doesn’t exist or stock reconciliation otherwise,
i can easily get warehouse items levels using get_items
from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import get_items
and do the check up and opening stock and it works fine, however when trying to do stock reconciliation it doesn’t give any error and shows it succeeded, but no thing appears in stock reconciliation list and opening stock
even it says here 44
i also tried to do a stock entry (purpose: Material issue ) and sometimes works and sometimes disappers from list as it didn’t exist like stock reconciliation.
i noticed that it happens if any error happened during creating any doc weather stock entry ,stock reconciliation or opening stock .
which i believe is responsible for the total mess
here is the code i use for stock reconciliation and opening stock and stock entry
what could be the issue?