Cannot assign ownership of entities to users in CRM 2013

I recently dealt with an issue in a CRM2013 organisation that had been upgraded from CRM3, to CRM4, to CRM2011 and eventually to CRM2013 where users were unable to assign ownership of Accounts and Contacts to users. When accessing the assign functionality through the ribbon or the owner field on the form, the Look for field is disabled and there is no way to assign the record to a user.
Look for control disabled

After investigating several dead-ends, I compared the XML of the account entity from an organisation created in CRM2013 and the one that had been upgraded over the years and discovered the following suspicious sections in the upgraded organisation:

<attribute PhysicalName="OwnerId">
  <Type>owner</Type>
  <Name>ownerid</Name>
  <LogicalName>ownerid</LogicalName>
  <RequiredLevel>systemrequired</RequiredLevel>
  <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
  <ImeMode>auto</ImeMode>
  <ValidForReadApi>1</ValidForReadApi>
  <ValidForCreateApi>1</ValidForCreateApi>
  <IsCustomField>0</IsCustomField>
  <IsAuditEnabled>1</IsAuditEnabled>
  <IsSecured>0</IsSecured>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <LookupStyle>single</LookupStyle>
  <LookupTypes>
    <LookupType id="00000000-0000-0000-0000-000000000000">9</LookupType>
  </LookupTypes>
  <displaynames>
    <displayname description="Owner" languagecode="1033" />
  </displaynames>
  <Descriptions>
    <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
  </Descriptions>
</attribute>
<EntityRelationship Name="owner_accounts">
  <EntityRelationshipType>OneToMany</EntityRelationshipType>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <ReferencingEntityName>Account</ReferencingEntityName>
  <ReferencedEntityName>Owner</ReferencedEntityName>
  <CascadeAssign>NoCascade</CascadeAssign>
  <CascadeDelete>NoCascade</CascadeDelete>
  <CascadeReparent>NoCascade</CascadeReparent>
  <CascadeShare>NoCascade</CascadeShare>
  <CascadeUnshare>NoCascade</CascadeUnshare>
  <ReferencingAttributeName>OwnerId</ReferencingAttributeName>
  <RelationshipDescription>
    <Descriptions>
      <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
    </Descriptions>
  </RelationshipDescription>
  <field name="ownerid" requiredlevel="systemrequired" imemode="auto" lookupstyle="single" lookupbrowse="0" lookuptypes="9">
    <IsSecured>0</IsSecured>
    <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
    <IsAuditEnabled>1</IsAuditEnabled>
    <displaynames>
      <displayname description="Owner" languagecode="1033" />
    </displaynames>
  </field>
</EntityRelationship>

The two sections above filter the lookup types of the ownerid field to 9 (Team) and completely exclude 8 (User). After updating the sections above in each entity I was experiencing the problem with to match the same sections from the organisation that was created in CRM2013 (see below) and re-importing, the Look for control now contains both User and Team and allows selection of either.

<attribute PhysicalName="OwnerId">
  <Type>owner</Type>
  <Name>ownerid</Name>
  <LogicalName>ownerid</LogicalName>
  <RequiredLevel>systemrequired</RequiredLevel>
  <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
  <ImeMode>auto</ImeMode>
  <ValidForReadApi>1</ValidForReadApi>
  <ValidForCreateApi>1</ValidForCreateApi>
  <IsCustomField>0</IsCustomField>
  <IsAuditEnabled>1</IsAuditEnabled>
  <IsSecured>0</IsSecured>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <LookupStyle>single</LookupStyle>
  <LookupTypes>
    <LookupType id="00000000-0000-0000-0000-000000000000">8</LookupType>
    <LookupType id="00000000-0000-0000-0000-000000000000">9</LookupType>
  </LookupTypes>
  <displaynames>
    <displayname description="Owner" languagecode="1033" />
  </displaynames>
  <Descriptions>
    <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
  </Descriptions>
</attribute>
<EntityRelationship Name="owner_accounts">
  <EntityRelationshipType>OneToMany</EntityRelationshipType>
  <IntroducedVersion>5.0.0.0</IntroducedVersion>
  <ReferencingEntityName>Account</ReferencingEntityName>
  <ReferencedEntityName>Owner</ReferencedEntityName>
  <CascadeAssign>NoCascade</CascadeAssign>
  <CascadeDelete>NoCascade</CascadeDelete>
  <CascadeReparent>NoCascade</CascadeReparent>
  <CascadeShare>NoCascade</CascadeShare>
  <CascadeUnshare>NoCascade</CascadeUnshare>
  <ReferencingAttributeName>OwnerId</ReferencingAttributeName>
  <RelationshipDescription>
    <Descriptions>
      <Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
    </Descriptions>
  </RelationshipDescription>
  <field name="ownerid" requiredlevel="systemrequired" imemode="auto" lookupstyle="single" lookupbrowse="0" lookuptypes="8, 9">
    <IsSecured>0</IsSecured>
    <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
    <IsAuditEnabled>1</IsAuditEnabled>
    <displaynames>
      <displayname description="Owner" languagecode="1033" />
    </displaynames>
  </field>
</EntityRelationship>

So, to summarise the fix for the issue:

  1. Create a solution with the entities that do not allow assignment to users.
  2. Export the solution.
  3. Extract the solution.
  4. Open customizations.xml.
  5. For each entity, replace the sections in Example 1.1 and Example 1.2 with the sections from Example 2.1 and Example 2.2 respectively.
  6. Zip the customisation files up again.
  7. Import the customisation zip file.
  8. Publish the customisations.
  9. Sit back and enjoy a Look for control that allows selection of users again:

Look for fixed