I want to create sales invoice document automatically on the basis on other doctype

@Mohtashim_Shoaib refer this Get Mapped doc documentation