The error you are getting is the result of modifying the key to the record.
You need to check your code and remove anything that will change the key. For example: if your code does something like this:
OrdersProduct currentProduct = {populate from database};
...
currentProduct = modifiedProduct;
That is bad -- especially if you are letting your user get access to the key field and modifying it!!!
Also make certain you're not modifying the field 'ID' anywhere yourself!