A Sale Order Line has a Subscription ID.
You can navigate from the Sale Order Line to the Subscription to the Subscription Lines, find the matching product and move the commission rate over that way.
Note: This code sample doesn't do anything apart from look for a matching product. If you have different rates for the same product on the Sales Order it won't work - this is just meant to get you started.
You can probably create a related field on the Invoice to grab the rate from the Subscription Line.
1. Create a Server Action that you add to the Form View of the Sales Order via a custom BUTTON.
# confirm the Sales Order
record.action_confirm()
# do we have order lines?
if record.order_line:
# loop through order lines
for so_line in record.order_line:
#do we have a subscription created and linked to the so line
if so_line.subscription_id:
#do we have lines on the subscription?
if so_line.subscription_id.recurring_invoice_line_ids:
#loop through the subscription lines
for sub_line in so_line.subscription_id.recurring_invoice_line_ids:
#do the products match?
if so_line.product_id.id == sub_line.product_id.id:
#copy commission
sub_line['x_commission'] = so_line.x_commission
2. Hide the CONFIRM ORDER button so users use your button instead.