[
https://issues.apache.org/jira/browse/OFBIZ-11683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17284669#comment-17284669 ]
Sebastian Berg commented on OFBIZ-11683:
----------------------------------------
After some further investigation I know why OUs can be added again.
With right-click add OU the function 'createInternalOrg' gets called. In this event the 'roleTypeIdFrom' and 'roleTypeIdTo' gets set to 'INTERNAL_ORGANIZATIO' and the service 'createPartyRelationship' is called.
'createPartyRelationship' checks whether the relation already exists. The existing relations shown in the tree are initialized with 'roleTypeIdFrom' and 'roleTypeIdTo' = "_NA_". Therefore a new 'PartyRelationship' is created.
For the most part this can be easily fixed by changing the roleTypes in the demo data, 'DemoLeadOwnersGroup' is a special case. 'DemoLeadOwnersGroup' has the associated partyRoles '_NA_' and 'OTHER_ORGANIZATION_U' but is still assigned with 'INTERNAL_ORGANIZATIO'.
I am not sure what's the best way to approach this, some input would be helpful.
> Humanres tree right-click pop-up menu allows existing OU to be added again
> --------------------------------------------------------------------------
>
> Key: OFBIZ-11683
> URL:
https://issues.apache.org/jira/browse/OFBIZ-11683> Project: OFBiz
> Issue Type: Bug
> Components: humanres
> Affects Versions: Release Branch 18.12, Release Branch 17.12, Trunk
> Reporter: Pierre Smits
> Assignee: Sebastian Berg
> Priority: Major
> Labels: usability
> Attachments: Screen Shot 2020-05-09 at 22.02.48.png, Screen Shot 2020-05-09 at 22.03.09.png, Screen Shot 2020-05-09 at 22.03.25.png
>
>
> When on the main page, the user right-clicks on an organisation or organisation unit (OU) to add an new subordinate organisation unit, an existing OU can be added again.
> See attached images.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)