From 6f3b982c5d610ec8a5caeae036d382e82643f538 Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Tue, 26 Mar 2019 11:45:57 +0100
Subject: [PATCH] fix displayValue for simple attribute name

---
 .../ab_attribute_id/displayValueProcess.js             |  4 +++-
 .../SalesprojectCompetition_entity.aod                 |  1 +
 .../SalesprojectCompetitionEdit_view.aod               |  5 -----
 process/Attribute_lib/process.js                       | 10 +++++++---
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/displayValueProcess.js b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/displayValueProcess.js
index 7375ee03d22..acda6626ab4 100644
--- a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/displayValueProcess.js
+++ b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/displayValueProcess.js
@@ -2,4 +2,6 @@ import("system.vars");
 import("system.result");
 import("Attribute_lib");
 
-result.string(AttributeUtil.getFullAttributeName(vars.get("$field.AB_ATTRIBUTE_ID")));
\ No newline at end of file
+result.string(AttributeUtil.getFullAttributeName(
+        vars.get("$field.AB_ATTRIBUTE_ID"),
+        vars.exists("$param.DisplaySimpleName_param") ? vars.get("$param.DisplaySimpleName_param") : false ));
\ No newline at end of file
diff --git a/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod b/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod
index bdd5fa2a86d..33fcc987940 100644
--- a/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod
+++ b/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod
@@ -219,6 +219,7 @@
       <name>Attributes</name>
       <title>Attributes</title>
       <fieldType>DEPENDENCY_OUT</fieldType>
+      <state>DISABLED</state>
       <dependency>
         <name>dependency</name>
         <entityName>AttributeRelation_entity</entityName>
diff --git a/neonView/SalesprojectCompetitionEdit_view/SalesprojectCompetitionEdit_view.aod b/neonView/SalesprojectCompetitionEdit_view/SalesprojectCompetitionEdit_view.aod
index badeadd20fb..16ddeeaa248 100644
--- a/neonView/SalesprojectCompetitionEdit_view/SalesprojectCompetitionEdit_view.aod
+++ b/neonView/SalesprojectCompetitionEdit_view/SalesprojectCompetitionEdit_view.aod
@@ -51,10 +51,5 @@
         </entityFieldLink>
       </fields>
     </genericViewTemplate>
-    <neonViewReference>
-      <name>cba34c27-9abf-416b-99fc-f7e91bd3669c</name>
-      <entityField>Attributes</entityField>
-      <view>AttributeRelationEdit_view</view>
-    </neonViewReference>
   </children>
 </neonView>
diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js
index fcd1ba99fa4..6b234d3c235 100644
--- a/process/Attribute_lib/process.js
+++ b/process/Attribute_lib/process.js
@@ -61,11 +61,15 @@ AttributeUtil.getPossibleAttributes = function (pObjectType, pIncludeGroups, pFi
  * returns the name of an attribute with all parent attribute names
  * 
  * @param {String} pAttributeId the id of the attribute
+ * @param {Boolean} [pSimpleName=false] Use only the name of the attribute and not the names of the parents.
  * 
  * @return {String} the name of the attribute
  */
-AttributeUtil.getFullAttributeName = function (pAttributeId) 
+AttributeUtil.getFullAttributeName = function (pAttributeId, pSimpleName) 
 {
+    if (pSimpleName == undefined)
+        pSimpleName = false;
+    
     if (!pAttributeId)
         return "";
     var attributeNames = [];
@@ -83,8 +87,8 @@ AttributeUtil.getFullAttributeName = function (pAttributeId)
         }
         else
             pAttributeId = "";
-    } while (pAttributeId);
-
+    } while (pAttributeId && !pSimpleName);
+    
     return attributeNames.reverse().join(" / ");
 }
 
-- 
GitLab