Generate a ledger journal

I want to generate a ledger journal after validate invoice but I do not find where can i put my code

Moving to developer forum. please always post in the relevant forum with a version tag.

Your description doesn’t really enough to understand the issue. Please try elaborating the requirement.