IDEMPIERE-5944 - Default value of Yes/No columns (#2121)

* IDEMPIERE-5944 - Default value of Yes/No columns
This commit is contained in:
Vitor Villa 2023-12-07 09:40:28 -03:00 committed by GitHub
parent d6121597b0
commit 342a243c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -561,6 +561,16 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport
return false;
}
}
if (getAD_Reference_ID() == DisplayType.YesNo) {
setIsMandatory(true);
if (Util.isEmpty(getDefaultValue(), true)) {
if (getAD_Element_ID() == SystemIDs.ELEMENT_ISACTIVE)
setDefaultValue("Y");
else
setDefaultValue("N");
}
}
return true;
} // beforeSave