[Help] ValidationError when trying to automate Work Order from a valid Sales Order

Hi everyone,

I’m working on an automation and have run into a challenge that I’d like to share to see if anyone has encountered something similar.

The goal is to create an automation where, upon submitting a Sales Order, the system automatically creates and submits the corresponding Work Order and “Manufacture” Stock Entry for the producible items.

Has anyone in the community successfully implemented a synchronous and immediate automation like this? Is there a specific field, flag, or method that needs to be passed when creating the Work Order via script to make the Sales Order validation pass during the On Submit event?