I’m trying to programmatically cancel a Stock Entry and then immediately delete it.
The cancellation itself works, but when I attempt to delete the document right afterward, I receive the following error:
Cannot cancel as processing of cancelled documents is pending. Please try again in an hour.
Do you have any recommendations on the correct approach to handle this?
Is there any way to force a synchronous Repost Item Valuation for that stock_entry right after the cancel ?