IDEMPIERE-5827: AD_Preference.PreferenceFor should support Forms (#1970)

* IDEMPIERE-5827: AD_Preference.PreferenceFor should support Forms

https://idempiere.atlassian.net/browse/IDEMPIERE-5827

* IDEMPIERE-5827: AD_Preference.PreferenceFor should support Forms : scripts on iD11

* IDEMPIERE-5827: AD_Preference.PreferenceFor should support Forms - remove changes related to Info Window

* IDEMPIERE-5827: AD_Preference.PreferenceFor should support Forms : remove changes related to Info Window

* Update oracle/202308101331_IDEMPIERE-5827.sql

* Update postgresql/202308101331_IDEMPIERE-5827.sql

---------

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
Nicolas Micoud 2023-09-05 15:43:01 +02:00 committed by GitHub
parent f0bdcbb913
commit 51c3bf5e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 173 additions and 1 deletions

View File

@ -0,0 +1,65 @@
-- IDEMPIERE-5827
SELECT register_migration_script('202308101331_IDEMPIERE-5827.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Aug 10, 2023, 1:31:49 PM CEST
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 (200642,'Form',200084,'X',0,0,'Y',TO_TIMESTAMP('2023-08-10 13:31:48','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2023-08-10 13:31:48','YYYY-MM-DD HH24:MI:SS'),10,'D','0b1e6c9b-2cc6-4a53-bb47-42dee6f1105d')
;
-- Aug 10, 2023, 1:32:31 PM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215907,1,'Special Form','Special Form','The Special Form field identifies a unique Special Form in the system.',195,'AD_Form_ID',22,'N','N','N','N','N',0,'N',30,0,0,'Y',TO_TIMESTAMP('2023-08-10 13:32:30','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2023-08-10 13:32:30','YYYY-MM-DD HH24:MI:SS'),10,1298,'Y','N','D','N','N','N','N','c90974fc-f238-45ff-a133-6a58b08c0bd2','N','N','N','N','N')
;
-- Aug 10, 2023, 1:32:32 PM CEST
UPDATE AD_Column SET FKConstraintName='ADForm_ADPreference', FKConstraintType='N',Updated=TO_TIMESTAMP('2023-08-10 13:32:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=215907
;
-- Aug 10, 2023, 1:32:32 PM CEST
ALTER TABLE AD_Preference ADD AD_Form_ID NUMBER(10) DEFAULT NULL
;
-- Aug 10, 2023, 1:32:32 PM CEST
ALTER TABLE AD_Preference ADD CONSTRAINT ADForm_ADPreference FOREIGN KEY (AD_Form_ID) REFERENCES ad_form(ad_form_id) DEFERRABLE INITIALLY DEFERRED
;
-- Aug 10, 2023, 1:32:45 PM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207715,'Special Form','Special Form','The Special Form field identifies a unique Special Form in the system.',156,215907,'Y',22,110,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2023-08-10 13:32:45','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2023-08-10 13:32:45','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','422d46ed-8239-46cf-91f7-2394ea86c8e7','Y',120,2)
;
-- Aug 10, 2023, 1:37:05 PM CEST
UPDATE AD_Column SET IsAllowLogging='Y', IsAllowCopy='Y',Updated=TO_TIMESTAMP('2023-08-10 13:37:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=215907
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203058
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=877
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', DisplayLogic='@PreferenceFor@=W', SeqNo=70, XPosition=1,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=876
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', DisplayLogic='@PreferenceFor@=P', SeqNo=80, XPosition=1,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203059
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET DisplayLogic='@PreferenceFor@=I', SeqNo=90,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207714
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET DisplayLogic='@PreferenceFor@=X', SeqNo=100,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207715
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, XPosition=5,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=662
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204556
;

View File

@ -0,0 +1,62 @@
-- IDEMPIERE-5827
SELECT register_migration_script('202308101331_IDEMPIERE-5827.sql') FROM dual;
-- Aug 10, 2023, 1:31:49 PM CEST
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 (200642,'Form',200084,'X',0,0,'Y',TO_TIMESTAMP('2023-08-10 13:31:48','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2023-08-10 13:31:48','YYYY-MM-DD HH24:MI:SS'),10,'D','0b1e6c9b-2cc6-4a53-bb47-42dee6f1105d')
;
-- Aug 10, 2023, 1:32:31 PM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215907,1,'Special Form','Special Form','The Special Form field identifies a unique Special Form in the system.',195,'AD_Form_ID',22,'N','N','N','N','N',0,'N',30,0,0,'Y',TO_TIMESTAMP('2023-08-10 13:32:30','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2023-08-10 13:32:30','YYYY-MM-DD HH24:MI:SS'),10,1298,'Y','N','D','N','N','N','N','c90974fc-f238-45ff-a133-6a58b08c0bd2','N','N','N','N','N')
;
-- Aug 10, 2023, 1:32:32 PM CEST
UPDATE AD_Column SET FKConstraintName='ADForm_ADPreference', FKConstraintType='N',Updated=TO_TIMESTAMP('2023-08-10 13:32:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=215907
;
-- Aug 10, 2023, 1:32:32 PM CEST
ALTER TABLE AD_Preference ADD COLUMN AD_Form_ID NUMERIC(10) DEFAULT NULL
;
-- Aug 10, 2023, 1:32:32 PM CEST
ALTER TABLE AD_Preference ADD CONSTRAINT ADForm_ADPreference FOREIGN KEY (AD_Form_ID) REFERENCES ad_form(ad_form_id) DEFERRABLE INITIALLY DEFERRED
;
-- Aug 10, 2023, 1:32:45 PM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207715,'Special Form','Special Form','The Special Form field identifies a unique Special Form in the system.',156,215907,'Y',22,110,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2023-08-10 13:32:45','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2023-08-10 13:32:45','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','422d46ed-8239-46cf-91f7-2394ea86c8e7','Y',120,2)
;
-- Aug 10, 2023, 1:37:05 PM CEST
UPDATE AD_Column SET IsAllowLogging='Y', IsAllowCopy='Y',Updated=TO_TIMESTAMP('2023-08-10 13:37:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=215907
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203058
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=877
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', DisplayLogic='@PreferenceFor@=W', SeqNo=70, XPosition=1,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=876
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', DisplayLogic='@PreferenceFor@=P', SeqNo=80, XPosition=1,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203059
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET DisplayLogic='@PreferenceFor@=I', SeqNo=90,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207714
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET DisplayLogic='@PreferenceFor@=X', SeqNo=100,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207715
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, XPosition=5,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=662
;
-- Sep 5, 2023, 3:38:10 PM CEST
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-09-05 15:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204556
;

View File

@ -49,6 +49,21 @@ public interface I_AD_Preference
*/ */
public int getAD_Client_ID(); public int getAD_Client_ID();
/** Column name AD_Form_ID */
public static final String COLUMNNAME_AD_Form_ID = "AD_Form_ID";
/** Set Special Form.
* Special Form
*/
public void setAD_Form_ID (int AD_Form_ID);
/** Get Special Form.
* Special Form
*/
public int getAD_Form_ID();
public org.compiere.model.I_AD_Form getAD_Form() throws RuntimeException;
/** Column name AD_InfoWindow_ID */ /** Column name AD_InfoWindow_ID */
public static final String COLUMNNAME_AD_InfoWindow_ID = "AD_InfoWindow_ID"; public static final String COLUMNNAME_AD_InfoWindow_ID = "AD_InfoWindow_ID";

View File

@ -31,7 +31,7 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20230904L; private static final long serialVersionUID = 20230905L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Preference (Properties ctx, int AD_Preference_ID, String trxName) public X_AD_Preference (Properties ctx, int AD_Preference_ID, String trxName)
@ -117,6 +117,34 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
return sb.toString(); return sb.toString();
} }
public org.compiere.model.I_AD_Form getAD_Form() throws RuntimeException
{
return (org.compiere.model.I_AD_Form)MTable.get(getCtx(), org.compiere.model.I_AD_Form.Table_ID)
.getPO(getAD_Form_ID(), get_TrxName());
}
/** Set Special Form.
@param AD_Form_ID Special Form
*/
public void setAD_Form_ID (int AD_Form_ID)
{
if (AD_Form_ID < 1)
set_Value (COLUMNNAME_AD_Form_ID, null);
else
set_Value (COLUMNNAME_AD_Form_ID, Integer.valueOf(AD_Form_ID));
}
/** Get Special Form.
@return Special Form
*/
public int getAD_Form_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Form_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_InfoWindow getAD_InfoWindow() throws RuntimeException public org.compiere.model.I_AD_InfoWindow getAD_InfoWindow() throws RuntimeException
{ {
return (org.compiere.model.I_AD_InfoWindow)MTable.get(getCtx(), org.compiere.model.I_AD_InfoWindow.Table_ID) return (org.compiere.model.I_AD_InfoWindow)MTable.get(getCtx(), org.compiere.model.I_AD_InfoWindow.Table_ID)
@ -297,6 +325,8 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
public static final String PREFERENCEFOR_Process = "P"; public static final String PREFERENCEFOR_Process = "P";
/** Window = W */ /** Window = W */
public static final String PREFERENCEFOR_Window = "W"; public static final String PREFERENCEFOR_Window = "W";
/** Form = X */
public static final String PREFERENCEFOR_Form = "X";
/** Set Preference For. /** Set Preference For.
@param PreferenceFor Type of preference, it can window, info window or parameter process @param PreferenceFor Type of preference, it can window, info window or parameter process
*/ */