1. open Account Element
2. click duplicate
3. save new record
=> tree is copy, when click a tree item, a error message is display
even reopen New account Element, tree is still here.
Problem is as Carlos mentioned, you cant have multiple elements pointed to same tree, it's logical mistake.
Problem is that elements share same tree, and tree is rendered based on these records but these tree nodes are joined only to element values where they was created.
I think that two thing should be definitely fixed:
One tree can be used only on one Account Element (globally on tree can be used only on one record, when tree is defined on 'header' record and childs are on 'line' records)
When nodes are inserting to the tree (PO.insert_tree), they should be inserted only for one specific tree, not for all trees by specific type as it is now - PO.insert_tree should be extended by parameter AD_Tree_ID which will ensure that nodes will be created only for specified tree
Just my opinion which is result by some days spent with implementing custom tree.
Reproduced exactly as explains.
Decreasing the priority as is a configuration mistake.
Suggesting a simple possible solution, we could add a unique index on C_Element.AD_Tree_ID