diff --git a/migration/i7.1/oracle/202003241800_IDEMPIERE-4221.sql b/migration/i7.1/oracle/202003241800_IDEMPIERE-4221.sql
new file mode 100644
index 0000000000..25890cf5f4
--- /dev/null
+++ b/migration/i7.1/oracle/202003241800_IDEMPIERE-4221.sql
@@ -0,0 +1,19 @@
+SET SQLBLANKLINES ON
+SET DEFINE OFF
+
+-- IDEMPIERE-4221 PackOut type Data Single (FHCA-1198)
+-- Mar 24, 2020, 6:00:23 PM CET
+INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200492,'Data Single',50004,'DS',0,0,'Y',TO_DATE('2020-03-24 18:00:23','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2020-03-24 18:00:23','YYYY-MM-DD HH24:MI:SS'),100,'D','bb6620c6-4cef-4796-90d6-007b83fe213f')
+;
+
+-- Mar 24, 2020, 6:26:24 PM CET
+UPDATE AD_Field SET DisplayLogic='@Type@=''T''|@Type@=''D''|@Type@=''DS''', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-03-24 18:26:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50103
+;
+
+-- Mar 24, 2020, 6:28:56 PM CET
+UPDATE AD_Field SET DisplayLogic='@Type@=''D''|@Type@=''DS''|Type@=''SQL''|Type@=''SQM''', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-03-24 18:28:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50105
+;
+
+SELECT register_migration_script('202003241800_IDEMPIERE-4221.sql') FROM dual
+;
+
diff --git a/migration/i7.1/postgresql/202003241800_IDEMPIERE-4221.sql b/migration/i7.1/postgresql/202003241800_IDEMPIERE-4221.sql
new file mode 100644
index 0000000000..05d0696ddc
--- /dev/null
+++ b/migration/i7.1/postgresql/202003241800_IDEMPIERE-4221.sql
@@ -0,0 +1,16 @@
+-- IDEMPIERE-4221 PackOut type Data Single (FHCA-1198)
+-- Mar 24, 2020, 6:00:23 PM CET
+INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200492,'Data Single',50004,'DS',0,0,'Y',TO_TIMESTAMP('2020-03-24 18:00:23','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2020-03-24 18:00:23','YYYY-MM-DD HH24:MI:SS'),100,'D','bb6620c6-4cef-4796-90d6-007b83fe213f')
+;
+
+-- Mar 24, 2020, 6:26:24 PM CET
+UPDATE AD_Field SET DisplayLogic='@Type@=''T''|@Type@=''D''|@Type@=''DS''', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-03-24 18:26:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50103
+;
+
+-- Mar 24, 2020, 6:28:56 PM CET
+UPDATE AD_Field SET DisplayLogic='@Type@=''D''|@Type@=''DS''|Type@=''SQL''|Type@=''SQM''', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-03-24 18:28:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50105
+;
+
+SELECT register_migration_script('202003241800_IDEMPIERE-4221.sql') FROM dual
+;
+
diff --git a/org.adempiere.base/src/org/compiere/model/MPackageExpDetail.java b/org.adempiere.base/src/org/compiere/model/MPackageExpDetail.java
index 06bc61f6f9..26309a56dd 100644
--- a/org.adempiere.base/src/org/compiere/model/MPackageExpDetail.java
+++ b/org.adempiere.base/src/org/compiere/model/MPackageExpDetail.java
@@ -91,6 +91,8 @@ public class MPackageExpDetail extends X_AD_Package_Exp_Detail
return 0;
} else if (TYPE_Data.equals(type)) {
return 0;
+ } else if (TYPE_DataSingle.equals(type)) {
+ return 0;
} else if (TYPE_DynamicValidationRule.equals(type)) {
return getAD_Val_Rule_ID();
} else if (TYPE_Form.equals(type)) {
diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp_Detail.java b/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp_Detail.java
index 1665f54786..5df052f50b 100644
--- a/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp_Detail.java
+++ b/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp_Detail.java
@@ -30,7 +30,7 @@ public class X_AD_Package_Exp_Detail extends PO implements I_AD_Package_Exp_Deta
/**
*
*/
- private static final long serialVersionUID = 20191121L;
+ private static final long serialVersionUID = 20200324L;
/** Standard Constructor */
public X_AD_Package_Exp_Detail (Properties ctx, int AD_Package_Exp_Detail_ID, String trxName)
@@ -945,6 +945,8 @@ public class X_AD_Package_Exp_Detail extends PO implements I_AD_Package_Exp_Deta
public static final String TYPE_SQLMandatory = "SQM";
/** Info Window = IW */
public static final String TYPE_InfoWindow = "IW";
+ /** Data Single = DS */
+ public static final String TYPE_DataSingle = "DS";
/** Set Type.
@param Type
Type of Validation (SQL, Java Script, Java Language)
diff --git a/org.adempiere.pipo.handlers/plugin.xml b/org.adempiere.pipo.handlers/plugin.xml
index 898e6fb806..818b89e3dc 100644
--- a/org.adempiere.pipo.handlers/plugin.xml
+++ b/org.adempiere.pipo.handlers/plugin.xml
@@ -180,6 +180,10 @@
class="org.adempiere.pipo2.handler.GenericPOElementHandler"
id="table.genericHandler">
+
+
diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java
index c4b9e40f86..6e98ff64d6 100644
--- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java
+++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java
@@ -32,6 +32,7 @@ import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.DataElementParameters;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.ElementHandler;
+import org.adempiere.pipo2.IHandlerRegistry;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PackoutItem;
@@ -172,7 +173,9 @@ public class GenericPOElementHandler extends AbstractElementHandler {
}
if (createElement) {
- if (po.get_KeyColumns() != null && po.get_KeyColumns().length == 1 && po.get_ID() > 0) {
+ //
+ if (po.get_KeyColumns() != null && po.get_KeyColumns().length == 1 && po.get_ID() > 0
+ && ! IHandlerRegistry.TABLE_GENERIC_SINGLE_HANDLER.equals(ctx.packOut.getCurrentPackoutItem().getType())) {
ElementHandler handler = ctx.packOut.getHandler(po.get_TableName());
if (handler != null && !handler.getClass().equals(this.getClass()) ) {
handler.packOut(ctx.packOut, document, ctx.logDocument, po.get_ID());
diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/IHandlerRegistry.java b/org.adempiere.pipo/src/org/adempiere/pipo2/IHandlerRegistry.java
index fd519f395f..09cbae743d 100644
--- a/org.adempiere.pipo/src/org/adempiere/pipo2/IHandlerRegistry.java
+++ b/org.adempiere.pipo/src/org/adempiere/pipo2/IHandlerRegistry.java
@@ -9,6 +9,7 @@ public interface IHandlerRegistry {
public static final String TABLE_TRANSLATION_HANDLER = "table.translationHandler";
public static final String TABLE_GENERIC_HANDLER = "table.genericHandler";
+ public static final String TABLE_GENERIC_SINGLE_HANDLER = "table.genericSingleHandler";
/**
* @param element
diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java
index e7c267d197..362d4a346d 100644
--- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java
+++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java
@@ -162,6 +162,8 @@ public class PackOutProcess extends SvrProcess
return "Code_Snipit";
else if (X_AD_Package_Exp_Detail.TYPE_Data.equals(type))
return IHandlerRegistry.TABLE_GENERIC_HANDLER;
+ else if (X_AD_Package_Exp_Detail.TYPE_DataSingle.equals(type))
+ return IHandlerRegistry.TABLE_GENERIC_SINGLE_HANDLER;
else if (X_AD_Package_Exp_Detail.TYPE_DynamicValidationRule.equals(type))
return I_AD_Val_Rule.Table_Name;
else if (X_AD_Package_Exp_Detail.TYPE_File_CodeOrOther.equals(type))
@@ -204,7 +206,7 @@ public class PackOutProcess extends SvrProcess
private Map getExpProperties(MPackageExpDetail dtl) {
Map properties = new HashMap();
String type = dtl.getType();
- if (MPackageExpDetail.TYPE_Data.equals(type)) {
+ if (MPackageExpDetail.TYPE_Data.equals(type) || MPackageExpDetail.TYPE_DataSingle.equals(type)) {
properties.put(DataElementParameters.AD_TABLE_ID, dtl.getAD_Table_ID());
properties.put(DataElementParameters.SQL_STATEMENT, dtl.getSQLStatement());
} else if (MPackageExpDetail.TYPE_SQLStatement.equals(type) || MPackageExpDetail.TYPE_SQLMandatory.equals(type)) {