Hello, i have a problem with on_update hook method

Hello,

i use a hook method on_update in our custom app for sales invoice.
issue is when i submit this doctype and if any validation error like warehouse or item not available etc. and then i refresh this document submitted automatically but really this change status in db not really submitted this doc .

how to solve this issue


this is urgent for me so, please give me suggestions how can i solve this

Kindly attach your error screen shot for reference