Stock Entry at submit custom doctype

Hello everyone

I did a doctype called “Shoal” I’m trying to generate a stock entry for a “Shoal Item” table
when validating the document

I know I can create a custom script
any idea how I can do it

follow this topic