IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) (#2122)

* IDEMPIERE-5567 Support of UUID as Key (FHCA-4195)

- fix issue creating a new record by calling table.getPO(0, trxName)
  when the table is UUID then create the new record calling the corresponding UUID method

* - remove unnecessary condition
This commit is contained in:
Carlos Ruiz 2023-11-28 10:57:59 +01:00 committed by GitHub
parent 36d81c258e
commit de1a0d9d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -53,6 +53,8 @@ public abstract class AbstractModelFactory implements IModelFactory {
MTable table = MTable.get(Env.getCtx(), tableName);
if (table != null && table.isUUIDKeyTable())
{
if (Record_ID == 0) // this is the convention to create a new record
return getPO(clazz, tableName, "", trxName); // get new Record using UUID constructor
return null;
}