@YogiYang I checked the method you are using make_stock_entry and it only has 3 args (work_order_id, purpose, qty).
The warehouse that will be used is the wip_warehouse (work in progress) from work order.
And if the stock entry a material transfer then the purpose must be Material Transfer for Manufacture.
But if the purpose is something else, then the from_warehouse will be the wip_warehouse and the to_warehouse will be the finished good warehouse fg_warehouse from the work order.
@YogiYang Moreover, the make_stock_entry method doesn’t create an entry, it returns a dict object of the entry. So you can edit the result of the call and add then create the entry.