Relationship deleting after save

Hi, coming accross a strange problem. I have a custom module which is linked to Opportunity by relationship.

It will save the relationship between the two records fine on the first save, but if I go back to edit the Opportunity record on a different field then save it. It will then mark the relationship as deleted in the DB and show as blank on the Opportunity details screen.

Using version 7.11.7