When creating a new Rate Model Attribute from an existing Rate Model you see the following errors:
"Rate lines exists for this rate model." and "Invalid insert".
Step to Reproduce
Using an OOB Madrid Instance (Madrid P2)
1. Navigate to Project Administration ==> Rate Model ==> All and select an existing record.
2. Scroll down to the 'Rate Model Attributes' related list and click 'New' button.
3. Select an 'Entity' eg: Demand and then pick an 'Attribute' eg: 'Description', set priority to a unique value eg: 200
4. Save the record, the following error is seen:
"Rate lines exists for this rate model." and "Invalid insert"
This is working as expected, we cannot create or modify Rate Model attributes when they have exiting Rate Lines.
Only when you delete all the rate lines you are able to create a new Rate Model Attribute.