diff --git a/framework/webtools/groovyScripts/entity/FindGeneric.groovy b/framework/webtools/groovyScripts/entity/FindGeneric.groovy
index 39bdc7a1d8..d30557351c 100644
--- a/framework/webtools/groovyScripts/entity/FindGeneric.groovy
+++ b/framework/webtools/groovyScripts/entity/FindGeneric.groovy
@@ -86,7 +86,7 @@ if (modelEntity) {
'' +
'' +
'' +
- '' +
+ '' +
'' +
'' +
' ' +
diff --git a/framework/widget/dtd/widget-form.xsd b/framework/widget/dtd/widget-form.xsd
index c30d5a635b..5c6fd7cffe 100644
--- a/framework/widget/dtd/widget-form.xsd
+++ b/framework/widget/dtd/widget-form.xsd
@@ -496,6 +496,11 @@ under the License.
+
+
+ This field will let the user enable internal fields of entity
+
+
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java
index 6395da798a..3193c56a71 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java
@@ -758,7 +758,8 @@ public abstract class ModelForm extends ModelWidget {
Iterator modelFieldIter = modelEntity.getFieldsIterator();
while (modelFieldIter.hasNext()) {
ModelField modelField = modelFieldIter.next();
- if (modelField.getIsAutoCreatedInternal()) {
+ // auto-add only if field was generated automatically by the entity engine or including internally
+ if (modelField.getIsAutoCreatedInternal() && !autoFieldsEntity.includeInternal) {
// don't ever auto-add these, should only be added if explicitly referenced
continue;
}
@@ -1446,11 +1447,13 @@ public abstract class ModelForm extends ModelWidget {
public final String mapName;
public final String defaultFieldType;
public final int defaultPosition;
+ public final boolean includeInternal;
public AutoFieldsEntity(Element element) {
this.entityName = element.getAttribute("entity-name");
this.mapName = element.getAttribute("map-name");
this.defaultFieldType = element.getAttribute("default-field-type");
+ this.includeInternal = !"false".equals(element.getAttribute("include-internal"));
String positionStr = element.getAttribute("default-position");
int position = 1;
try {