IDEMPIERE-4993 : Tab Editor do not show field group when opened at tenant level (#914)

This commit is contained in:
Nicolas Micoud 2021-10-08 10:11:33 +02:00 committed by GitHub
parent c24270615e
commit 0509df7912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 16 deletions

View File

@ -921,26 +921,13 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
editorColumn.setValue(MColumn.getColumnName(Env.getCtx(), field.getAD_Column_ID()));
GridField gridField = getGridField(field);
String fieldGroup = "";
String fieldGroupType = "";
if (field.getAD_FieldGroup_ID() > 0) {
if (isBaseLang)
{
fieldGroup = field.getAD_FieldGroup().getName();
}
else
{
fieldGroup = ((X_AD_FieldGroup) field.getAD_FieldGroup()).get_Translation(X_AD_FieldGroup.COLUMNNAME_Name);
}
fieldGroupType = field.getAD_FieldGroup().getFieldGroupType();
}
gridField.getVO().Header = field.getName();
gridField.getVO().Description = field.getDescription();
gridField.getVO().Help = field.getHelp();
gridField.getVO().Placeholder = field.getPlaceholder();
gridField.getVO().IsDisplayed = field.isDisplayed();
gridField.getVO().FieldGroup = fieldGroup;
gridField.getVO().FieldGroupType = fieldGroupType;
gridField.getVO().FieldGroup = getFieldGroup(field);
gridField.getVO().FieldGroupType = getFieldGroupType(field);
gridField.getVO().XPosition = field.getXPosition();
gridField.getVO().ColumnSpan = field.getColumnSpan();
gridField.getVO().NumLines = field.getNumLines();

View File

@ -29,6 +29,7 @@ import org.compiere.model.I_AD_Field;
import org.compiere.model.MField;
import org.compiere.model.MTab;
import org.compiere.model.MUserDefField;
import org.compiere.model.X_AD_FieldGroup;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -110,6 +111,8 @@ public class TabEditor
gridField.getVO().XPosition = field.getXPosition();
gridField.getVO().ColumnSpan = field.getColumnSpan();
gridField.getVO().IsDisplayed = field.isDisplayed();
gridField.getVO().FieldGroup = getFieldGroup(field);
gridField.getVO().FieldGroupType = getFieldGroupType(field);
}
}
@ -447,5 +450,23 @@ public class TabEditor
}
}
}
/** Return the name of the group field of the field */
public String getFieldGroup(MField field) {
if (field.getAD_FieldGroup_ID() > 0) {
if (isBaseLang)
return field.getAD_FieldGroup().getName();
else
return ((X_AD_FieldGroup) field.getAD_FieldGroup()).get_Translation(X_AD_FieldGroup.COLUMNNAME_Name);
}
return "";
}
/** Return the type of the group field of the field */
public String getFieldGroupType(MField field) {
if (field.getAD_FieldGroup_ID() > 0)
return field.getAD_FieldGroup().getFieldGroupType();
return "";
}
} // TabEditor