If you have a location and a list of active parts associated to the location.
Then when creating an order for a location, create all orderlines based on the active parts that can be retrieved from the location in a microflow. Loop through the active parts, create an orderline for each part and associate this to the order and the part. Then display the orderlines created in the order in a listview that is editable to allow the user to enter the amount of a particular part to be ordered.
This would be my solution and I hope this gives you an idea on how to proceed in your particular case.
I do advise you to take this course; https://academy.mendix.com/link/path/31/Become-a-Rapid-Developer
The case of TrainingEvent with registrations is exactly the same as you seek.
TrainingEvent = Order
Registration = OrderLine
Trainee = Part
If Order is for a particular location then
Course = Location
If Parts of a particular location should be selectable;
Course = Location
AND
Parts have a reference to Location, so that parts can be constraint to the location set for the order