From e7b9b72582d0a1d5bb8df622f3aa151a0a41cfef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Tak=C3=A1cs?= <93127072+PeterTakacs300@users.noreply.github.com> Date: Fri, 17 Feb 2023 03:47:39 +0100 Subject: [PATCH] IDEMPIERE-5573 - Enable Showing Inactive Records through Reference (#1674) * IDEMPIERE-5573 - Enable Showing Inactive Records through Reference * IDEMPIERE-5573 - fixes --- .../oracle/202302131520_IDEMPIERE-5573.sql | 86 +++++++++++++++++++ .../202302131520_IDEMPIERE-5573.sql | 83 ++++++++++++++++++ .../org/compiere/model/I_AD_Reference.java | 41 ++++++--- .../src/org/compiere/model/MLookup.java | 4 +- .../src/org/compiere/model/MReference.java | 9 ++ .../org/compiere/model/X_AD_Reference.java | 63 ++++++++++---- .../webui/factory/DefaultInfoFactory.java | 41 +++++---- .../adempiere/webui/factory/IInfoFactory.java | 16 ++++ .../adempiere/webui/info/InfoAssetWindow.java | 5 +- .../webui/info/InfoAssignmentWindow.java | 6 +- .../webui/info/InfoBPartnerWindow.java | 9 +- .../adempiere/webui/info/InfoInOutWindow.java | 6 +- .../webui/info/InfoInvoiceWindow.java | 5 +- .../adempiere/webui/info/InfoOrderWindow.java | 6 +- .../webui/info/InfoPaymentWindow.java | 6 +- .../webui/info/InfoProductWindow.java | 23 ++++- .../org/adempiere/webui/info/InfoWindow.java | 5 +- .../webui/panel/InfoGeneralPanel.java | 24 ++++-- 18 files changed, 363 insertions(+), 75 deletions(-) create mode 100644 migration/iD11/oracle/202302131520_IDEMPIERE-5573.sql create mode 100644 migration/iD11/postgresql/202302131520_IDEMPIERE-5573.sql diff --git a/migration/iD11/oracle/202302131520_IDEMPIERE-5573.sql b/migration/iD11/oracle/202302131520_IDEMPIERE-5573.sql new file mode 100644 index 0000000000..cf48f7bffc --- /dev/null +++ b/migration/iD11/oracle/202302131520_IDEMPIERE-5573.sql @@ -0,0 +1,86 @@ +-- IDEMPIERE-5573 +SELECT register_migration_script('202302131520_IDEMPIERE-5573.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Feb 13, 2023, 3:20:01 PM CET +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203787,0,0,'Y',TO_TIMESTAMP('2023-02-13 15:20:01','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:20:01','YYYY-MM-DD HH24:MI:SS'),100,'ShowInactive','Show Inactive','Show Inactive Records','Show Inactive','D','c95fa8c2-91eb-4c57-8a93-5867af55151d') +; + +-- Feb 13, 2023, 3:20:44 PM CET +INSERT INTO AD_Reference (AD_Reference_ID,Name,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU) VALUES (200230,'AD_Reference Show Inactive','L',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:20:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:20:44','YYYY-MM-DD HH24:MI:SS'),100,'D','N','998ea62f-47e7-433e-9293-d49324d16c10') +; + +-- Feb 13, 2023, 3:21:46 PM CET +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,Description,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200626,'No','No Inactive Records',200230,'N',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:21:46','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:21:46','YYYY-MM-DD HH24:MI:SS'),100,'D','f99597a3-8f11-4547-8b62-ab918dad0f8b') +; + +-- Feb 13, 2023, 3:22:20 PM CET +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,Description,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200627,'Yes','Show all records (active/inactive)',200230,'Y',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:22:19','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:22:19','YYYY-MM-DD HH24:MI:SS'),100,'D','4116b567-0f8f-492d-a1f7-4ac3d5a53aaf') +; + +-- Feb 13, 2023, 3:23:16 PM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Reference_Value_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,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215772,0,'Show Inactive','Show Inactive Records',102,'ShowInactive','N',4,'N','N','Y','N','N',0,'N',17,200230,0,0,'Y',TO_TIMESTAMP('2023-02-13 15:23:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:23:15','YYYY-MM-DD HH24:MI:SS'),100,203787,'Y','N','D','N','N','N','Y','3215b375-ef7a-422b-af73-42ca0562bce9','N',0,'N','N','N','N') +; + +-- Feb 13, 2023, 3:23:19 PM CET +ALTER TABLE AD_Reference ADD ShowInactive VARCHAR2(4 CHAR) DEFAULT 'N' NOT NULL +; + +-- Feb 13, 2023, 3:57:23 PM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,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 (207567,'Show Inactive','Show Inactive Records',102,215772,'Y',4,130,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:57:22','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:57:22','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','f3f4797e-be33-47a5-8d7e-b765723c8ee6','Y',130,2) +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=258 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1985 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=30,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=107 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=108 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=109 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=257 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5123 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=178 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206184 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=314 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, XPosition=4,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207567 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204575 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=106 +; + diff --git a/migration/iD11/postgresql/202302131520_IDEMPIERE-5573.sql b/migration/iD11/postgresql/202302131520_IDEMPIERE-5573.sql new file mode 100644 index 0000000000..a9eb8efae4 --- /dev/null +++ b/migration/iD11/postgresql/202302131520_IDEMPIERE-5573.sql @@ -0,0 +1,83 @@ +-- IDEMPIERE-5573 +SELECT register_migration_script('202302131520_IDEMPIERE-5573.sql') FROM dual; + +-- Feb 13, 2023, 3:20:01 PM CET +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203787,0,0,'Y',TO_TIMESTAMP('2023-02-13 15:20:01','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:20:01','YYYY-MM-DD HH24:MI:SS'),100,'ShowInactive','Show Inactive','Show Inactive Records','Show Inactive','D','c95fa8c2-91eb-4c57-8a93-5867af55151d') +; + +-- Feb 13, 2023, 3:20:44 PM CET +INSERT INTO AD_Reference (AD_Reference_ID,Name,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU) VALUES (200230,'AD_Reference Show Inactive','L',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:20:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:20:44','YYYY-MM-DD HH24:MI:SS'),100,'D','N','998ea62f-47e7-433e-9293-d49324d16c10') +; + +-- Feb 13, 2023, 3:21:46 PM CET +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,Description,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200626,'No','No Inactive Records',200230,'N',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:21:46','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:21:46','YYYY-MM-DD HH24:MI:SS'),100,'D','f99597a3-8f11-4547-8b62-ab918dad0f8b') +; + +-- Feb 13, 2023, 3:22:20 PM CET +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,Description,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200627,'Yes','Show all records (active/inactive)',200230,'Y',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:22:19','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:22:19','YYYY-MM-DD HH24:MI:SS'),100,'D','4116b567-0f8f-492d-a1f7-4ac3d5a53aaf') +; + +-- Feb 13, 2023, 3:23:16 PM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Reference_Value_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,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215772,0,'Show Inactive','Show Inactive Records',102,'ShowInactive','N',4,'N','N','Y','N','N',0,'N',17,200230,0,0,'Y',TO_TIMESTAMP('2023-02-13 15:23:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:23:15','YYYY-MM-DD HH24:MI:SS'),100,203787,'Y','N','D','N','N','N','Y','3215b375-ef7a-422b-af73-42ca0562bce9','N',0,'N','N','N','N') +; + +-- Feb 13, 2023, 3:23:19 PM CET +ALTER TABLE AD_Reference ADD COLUMN ShowInactive VARCHAR(4) DEFAULT 'N' NOT NULL +; + +-- Feb 13, 2023, 3:57:23 PM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,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 (207567,'Show Inactive','Show Inactive Records',102,215772,'Y',4,130,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2023-02-13 15:57:22','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2023-02-13 15:57:22','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','f3f4797e-be33-47a5-8d7e-b765723c8ee6','Y',130,2) +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=258 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1985 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=30,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=107 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=108 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=109 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=257 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5123 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=178 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206184 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=314 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, XPosition=4,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207567 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204575 +; + +-- Feb 13, 2023, 3:57:39 PM CET +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-02-13 15:57:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=106 +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Reference.java b/org.adempiere.base/src/org/compiere/model/I_AD_Reference.java index 14d82cd1c0..f0f1a0477c 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Reference.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Reference.java @@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair; /** Generated Interface for AD_Reference * @author iDempiere (generated) - * @version Release 10 + * @version Release 11 */ public interface I_AD_Reference { @@ -195,6 +195,19 @@ public interface I_AD_Reference */ public String getName(); + /** Column name ShowInactive */ + public static final String COLUMNNAME_ShowInactive = "ShowInactive"; + + /** Set Show Inactive. + * Show Inactive Records + */ + public void setShowInactive (String ShowInactive); + + /** Get Show Inactive. + * Show Inactive Records + */ + public String getShowInactive(); + /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; @@ -211,19 +224,6 @@ public interface I_AD_Reference */ public int getUpdatedBy(); - /** Column name ValidationType */ - public static final String COLUMNNAME_ValidationType = "ValidationType"; - - /** Set Validation type. - * Different method of validating data - */ - public void setValidationType (String ValidationType); - - /** Get Validation type. - * Different method of validating data - */ - public String getValidationType(); - /** Column name VFormat */ public static final String COLUMNNAME_VFormat = "VFormat"; @@ -242,4 +242,17 @@ _lLoOaAcCa09" */ public String getVFormat(); + + /** Column name ValidationType */ + public static final String COLUMNNAME_ValidationType = "ValidationType"; + + /** Set Validation type. + * Different method of validating data + */ + public void setValidationType (String ValidationType); + + /** Get Validation type. + * Different method of validating data + */ + public String getValidationType(); } diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index 1359366391..041e92ca86 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -844,7 +844,9 @@ public final class MLookup extends Lookup implements Serializable { //force refresh m_lookup.clear(); - fillComboBox(isMandatory(), true, true, false, isShortList()); // idempiere 90 + MReference ref = m_info.AD_Reference_Value_ID > 0 ? MReference.get(Env.getCtx(),m_info.AD_Reference_Value_ID) : null; + boolean onlyActive = ref == null || !ref.isShowInactiveRecords(); + fillComboBox(isMandatory(), true, onlyActive, false, isShortList()); // idempiere 90 return m_lookup.size(); } finally diff --git a/org.adempiere.base/src/org/compiere/model/MReference.java b/org.adempiere.base/src/org/compiere/model/MReference.java index 9d98fb55df..c9a08c6979 100644 --- a/org.adempiere.base/src/org/compiere/model/MReference.java +++ b/org.adempiere.base/src/org/compiere/model/MReference.java @@ -28,6 +28,7 @@ import java.sql.ResultSet; import java.util.Properties; import org.compiere.util.Env; +import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; @@ -144,4 +145,12 @@ public class MReference extends X_AD_Reference implements ImmutablePOSupport { return this; } + /** + * Show inactive records + * @return + */ + public boolean isShowInactiveRecords() { + return !Util.isEmpty(getShowInactive()) && MReference.SHOWINACTIVE_Yes.equalsIgnoreCase(getShowInactive()); + } + } // MReference diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Reference.java b/org.adempiere.base/src/org/compiere/model/X_AD_Reference.java index 7505a3e50c..c650d42015 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Reference.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Reference.java @@ -23,7 +23,7 @@ import org.compiere.util.KeyNamePair; /** Generated Model for AD_Reference * @author iDempiere (generated) - * @version Release 10 - $Id$ */ + * @version Release 11 - $Id$ */ @org.adempiere.base.Model(table="AD_Reference") public class X_AD_Reference extends PO implements I_AD_Reference, I_Persistent { @@ -31,7 +31,7 @@ public class X_AD_Reference extends PO implements I_AD_Reference, I_Persistent /** * */ - private static final long serialVersionUID = 20221224L; + private static final long serialVersionUID = 20230213L; /** Standard Constructor */ public X_AD_Reference (Properties ctx, int AD_Reference_ID, String trxName) @@ -43,6 +43,8 @@ public class X_AD_Reference extends PO implements I_AD_Reference, I_Persistent setEntityType (null); // @SQL=SELECT CASE WHEN '@P|AdempiereSys:N@'='Y' THEN 'D' ELSE get_sysconfig('DEFAULT_ENTITYTYPE','U',0,0) END FROM Dual setName (null); + setShowInactive (null); +// N setValidationType (null); } */ } @@ -57,6 +59,8 @@ public class X_AD_Reference extends PO implements I_AD_Reference, I_Persistent setEntityType (null); // @SQL=SELECT CASE WHEN '@P|AdempiereSys:N@'='Y' THEN 'D' ELSE get_sysconfig('DEFAULT_ENTITYTYPE','U',0,0) END FROM Dual setName (null); + setShowInactive (null); +// N setValidationType (null); } */ } @@ -252,6 +256,45 @@ public class X_AD_Reference extends PO implements I_AD_Reference, I_Persistent return new KeyNamePair(get_ID(), getName()); } + /** ShowInactive AD_Reference_ID=200230 */ + public static final int SHOWINACTIVE_AD_Reference_ID=200230; + /** No = N */ + public static final String SHOWINACTIVE_No = "N"; + /** Yes = Y */ + public static final String SHOWINACTIVE_Yes = "Y"; + /** Set Show Inactive. + @param ShowInactive Show Inactive Records + */ + public void setShowInactive (String ShowInactive) + { + + set_Value (COLUMNNAME_ShowInactive, ShowInactive); + } + + /** Get Show Inactive. + @return Show Inactive Records + */ + public String getShowInactive() + { + return (String)get_Value(COLUMNNAME_ShowInactive); + } + + /** Set Value Format. + @param VFormat Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09" + */ + public void setVFormat (String VFormat) + { + set_Value (COLUMNNAME_VFormat, VFormat); + } + + /** Get Value Format. + @return Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09" + */ + public String getVFormat() + { + return (String)get_Value(COLUMNNAME_VFormat); + } + /** ValidationType AD_Reference_ID=2 */ public static final int VALIDATIONTYPE_AD_Reference_ID=2; /** DataType = D */ @@ -276,20 +319,4 @@ public class X_AD_Reference extends PO implements I_AD_Reference, I_Persistent { return (String)get_Value(COLUMNNAME_ValidationType); } - - /** Set Value Format. - @param VFormat Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09" - */ - public void setVFormat (String VFormat) - { - set_Value (COLUMNNAME_VFormat, VFormat); - } - - /** Get Value Format. - @return Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09" - */ - public String getVFormat() - { - return (String)get_Value(COLUMNNAME_VFormat); - } } \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java index 2c46d00939..c193e8d790 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java @@ -47,27 +47,34 @@ import org.compiere.util.Env; @SuppressWarnings("deprecation") public class DefaultInfoFactory implements IInfoFactory { + @Override + public InfoPanel create(int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, + String whereClause, int AD_InfoWindow_ID, boolean lookup) { + return create(WindowNo, tableName, keyColumn, + value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, null, null); + } + @Override public InfoPanel create(int WindowNo, String tableName, String keyColumn, - String value, boolean multiSelection, String whereClause, int AD_InfoWindow_ID, boolean lookup) { + String value, boolean multiSelection, String whereClause, int AD_InfoWindow_ID, boolean lookup, GridField field) { return create(WindowNo, tableName, keyColumn, - value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, null); + value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, null, field); } public InfoPanel create(int WindowNo, String tableName, String keyColumn, - String value, boolean multiSelection, String whereClause, int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + String value, boolean multiSelection, String whereClause, int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables, GridField field) { InfoPanel info = null; setSOTrxBasedOnDocType(WindowNo); if (tableName.equals("C_BPartner")) { - info = new InfoBPartnerWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoBPartnerWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoBPartnerPanel (value,WindowNo, !Env.getContext(Env.getCtx(), WindowNo, "IsSOTrx").equals("N"), multiSelection, whereClause, lookup); } } else if (tableName.equals("M_Product")) { - info = new InfoProductWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoProductWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoProductPanel ( WindowNo, Env.getContextAsInt(Env.getCtx(), WindowNo, "M_Warehouse_ID"), @@ -75,31 +82,31 @@ public class DefaultInfoFactory implements IInfoFactory { multiSelection, value,whereClause, lookup); } } else if (tableName.equals("C_Invoice")) { - info = new InfoInvoiceWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoInvoiceWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoInvoicePanel ( WindowNo, value, multiSelection, whereClause, lookup); } } else if (tableName.equals("A_Asset")) { - info = new InfoAssetWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoAssetWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoAssetPanel (WindowNo, 0, value, multiSelection, whereClause, lookup); } } else if (tableName.equals("C_Order")) { - info = new InfoOrderWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoOrderWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoOrderPanel ( WindowNo, value, multiSelection, whereClause, lookup); } } else if (tableName.equals("M_InOut")) { - info = new InfoInOutWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoInOutWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoInOutPanel (WindowNo, value, multiSelection, whereClause, lookup); } } else if (tableName.equals("C_Payment")) { - info = new InfoPaymentWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoPaymentWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoPaymentPanel (WindowNo, value, multiSelection, whereClause, lookup); } @@ -107,17 +114,17 @@ public class DefaultInfoFactory implements IInfoFactory { info = new InfoCashLinePanel (WindowNo, value, multiSelection, whereClause, lookup); } else if (tableName.equals("S_ResourceAssignment")) { - info = new InfoAssignmentWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, predefinedContextVariables); + info = new InfoAssignmentWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoAssignmentPanel (WindowNo, value, multiSelection, whereClause, lookup); } } else { - info = new InfoWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + info = new InfoWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); if (!info.loadedOK()) { info = new InfoGeneralPanel (value, WindowNo, tableName, keyColumn, - multiSelection, whereClause, lookup); + multiSelection, whereClause, lookup, field); if (!info.loadedOK()) { info.dispose(false); info = null; @@ -142,7 +149,7 @@ public class DefaultInfoFactory implements IInfoFactory { if (col.equals("M_Product_ID")) { - InfoWindow infoWindow = new InfoProductWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, true, whereClause, AD_InfoWindow_ID); + InfoWindow infoWindow = new InfoProductWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, true, whereClause, AD_InfoWindow_ID, true, field); if (infoWindow.loadedOK()) return infoWindow; @@ -162,7 +169,7 @@ public class DefaultInfoFactory implements IInfoFactory { } else if (col.equals("C_BPartner_ID")) { - InfoWindow infoWindow = new InfoBPartnerWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, multiSelection, whereClause, AD_InfoWindow_ID); + InfoWindow infoWindow = new InfoBPartnerWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, multiSelection, whereClause, AD_InfoWindow_ID, true, field); if (infoWindow.loadedOK()) return infoWindow; @@ -176,7 +183,7 @@ public class DefaultInfoFactory implements IInfoFactory { } else // General Info { - info = create(lookup.getWindowNo(), tableName, keyColumn, queryValue, multiSelection, whereClause, AD_InfoWindow_ID, true); + info = create(lookup.getWindowNo(), tableName, keyColumn, queryValue, multiSelection, whereClause, AD_InfoWindow_ID, true, field); } return info; } @@ -197,7 +204,7 @@ public class DefaultInfoFactory implements IInfoFactory { MInfoWindow infoWindow = MInfoWindow.getInfoWindow(AD_InfoWindow_ID); String tableName = infoWindow.getAD_Table().getTableName(); String keyColumn = tableName + "_ID"; - InfoPanel info = create(windowNo, tableName, keyColumn, null, false, null, AD_InfoWindow_ID, false, predefinedContextVariables); + InfoPanel info = create(windowNo, tableName, keyColumn, null, false, null, AD_InfoWindow_ID, false, predefinedContextVariables, null); if (info instanceof InfoWindow) return (InfoWindow) info; else diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/IInfoFactory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/IInfoFactory.java index 53c2c500b5..adac3fbdbd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/IInfoFactory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/IInfoFactory.java @@ -83,4 +83,20 @@ public interface IInfoFactory { public default InfoWindow create (int AD_InfoWindow_ID, String predefinedContextVariables) { return create (AD_InfoWindow_ID, predefinedContextVariables); } + + /** + * + * @param WindowNo + * @param tableName + * @param keyColumn + * @param value + * @param multiSelection + * @param whereClause + * @param AD_InfoWindow_ID + * @param lookup + * @param field + * @return {@link InfoPanel} + */ + public InfoPanel create(int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, + String whereClause, int AD_InfoWindow_ID, boolean lookup, GridField field); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssetWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssetWindow.java index 77a9b274a6..956201d665 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssetWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssetWindow.java @@ -3,6 +3,7 @@ */ package org.adempiere.webui.info; +import org.compiere.model.GridField; import org.compiere.util.Env; /** @@ -63,9 +64,9 @@ public class InfoAssetWindow extends InfoWindow { */ public InfoAssetWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } @Override diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssignmentWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssignmentWindow.java index b6cb994252..bb01c9707a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssignmentWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoAssignmentWindow.java @@ -3,6 +3,8 @@ */ package org.adempiere.webui.info; +import org.compiere.model.GridField; + /** * @author hengsin * @@ -60,8 +62,8 @@ public class InfoAssignmentWindow extends InfoWindow { */ public InfoAssignmentWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, - String whereClause, int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + String whereClause, int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoBPartnerWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoBPartnerWindow.java index 13722b3907..65677fb335 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoBPartnerWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoBPartnerWindow.java @@ -4,6 +4,7 @@ package org.adempiere.webui.info; import org.adempiere.webui.panel.InvoiceHistory; +import org.compiere.model.GridField; import org.compiere.util.Env; /** @@ -44,9 +45,9 @@ public class InfoBPartnerWindow extends InfoWindow { */ public InfoBPartnerWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup) { + int AD_InfoWindow_ID, boolean lookup, GridField field) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup); + whereClause, AD_InfoWindow_ID, lookup, field); } /** @@ -62,9 +63,9 @@ public class InfoBPartnerWindow extends InfoWindow { */ public InfoBPartnerWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInOutWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInOutWindow.java index bbbeca7371..f5b394339c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInOutWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInOutWindow.java @@ -3,6 +3,8 @@ */ package org.adempiere.webui.info; +import org.compiere.model.GridField; + /** * @author hengsin * @@ -59,8 +61,8 @@ public class InfoInOutWindow extends InfoWindow { */ public InfoInOutWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java index b9cb0ec47f..07a701f525 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java @@ -3,6 +3,7 @@ */ package org.adempiere.webui.info; +import org.compiere.model.GridField; import org.compiere.util.Env; /** @@ -61,9 +62,9 @@ public class InfoInvoiceWindow extends InfoWindow { */ public InfoInvoiceWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } @Override diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoOrderWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoOrderWindow.java index 3018b8be77..034795fa83 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoOrderWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoOrderWindow.java @@ -3,6 +3,8 @@ */ package org.adempiere.webui.info; +import org.compiere.model.GridField; + /** * @author hengsin * @@ -59,9 +61,9 @@ public class InfoOrderWindow extends InfoWindow { */ public InfoOrderWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java index aa3873d010..63ea20793d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java @@ -3,6 +3,8 @@ */ package org.adempiere.webui.info; +import org.compiere.model.GridField; + /** * @author hengsin * @@ -59,9 +61,9 @@ public class InfoPaymentWindow extends InfoWindow { */ public InfoPaymentWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index 7dfc0854e3..211f5ff5e2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -53,6 +53,7 @@ import org.adempiere.webui.panel.InvoiceHistory; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.minigrid.ColumnInfo; +import org.compiere.model.GridField; import org.compiere.model.MDocType; import org.compiere.model.MRole; import org.compiere.model.MSysConfig; @@ -137,6 +138,24 @@ public class InfoProductWindow extends InfoWindow { whereClause, AD_InfoWindow_ID, lookup); } + /** + * @param WindowNo + * @param tableName + * @param keyColumn + * @param queryValue + * @param multipleSelection + * @param whereClause + * @param AD_InfoWindow_ID + * @param lookup + * @param field + */ + public InfoProductWindow(int WindowNo, String tableName, String keyColumn, + String queryValue, boolean multipleSelection, String whereClause, + int AD_InfoWindow_ID, boolean lookup, GridField field) { + super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, + whereClause, AD_InfoWindow_ID, lookup, field); + } + /** * @param WindowNo * @param tableName @@ -150,9 +169,9 @@ public class InfoProductWindow extends InfoWindow { */ public InfoProductWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, - int AD_InfoWindow_ID, boolean lookup, String predefinedContextVariables) { + int AD_InfoWindow_ID, boolean lookup, GridField field, String predefinedContextVariables) { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, - whereClause, AD_InfoWindow_ID, lookup, null, predefinedContextVariables); + whereClause, AD_InfoWindow_ID, lookup, field, predefinedContextVariables); } @Override diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index 94ed6a239d..859eb2fd30 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -103,6 +103,7 @@ import org.compiere.model.MInfoWindow; import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupInfo; import org.compiere.model.MProcess; +import org.compiere.model.MReference; import org.compiere.model.MRole; import org.compiere.model.MSysConfig; import org.compiere.model.MTable; @@ -1066,7 +1067,9 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL StringBuilder builder = new StringBuilder(); MTable table = MTable.get(Env.getCtx(), infoWindow.getAD_Table_ID()); - if (!hasIsActiveEditor() && table.get_ColumnIndex("IsActive") >=0 ) { + MReference ref = m_gridfield != null && m_gridfield.getAD_Reference_Value_ID() > 0 ? MReference.get(Env.getCtx(), m_gridfield.getAD_Reference_Value_ID()) : null; + boolean onlyActive = ref == null || !ref.isShowInactiveRecords(); + if (!hasIsActiveEditor() && table.get_ColumnIndex("IsActive") >= 0 && onlyActive) { if (p_whereClause != null && p_whereClause.trim().length() > 0) { builder.append(" AND "); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index 671412a051..329969320c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -37,9 +37,11 @@ import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.Dialog; import org.compiere.minigrid.ColumnInfo; import org.compiere.minigrid.IDColumn; +import org.compiere.model.GridField; import org.compiere.model.I_C_ElementValue; import org.compiere.model.MColumn; import org.compiere.model.MLookupFactory; +import org.compiere.model.MReference; import org.compiere.model.MTable; import org.compiere.util.DB; import org.compiere.util.DisplayType; @@ -96,13 +98,14 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener public InfoGeneralPanel(String queryValue, int windowNo,String tableName,String keyColumn, boolean multipleSelection, String whereClause) { - this(queryValue, windowNo, tableName, keyColumn, multipleSelection, whereClause, true); + this(queryValue, windowNo, tableName, keyColumn, multipleSelection, whereClause, true, null); } - public InfoGeneralPanel(String queryValue, int windowNo,String tableName,String keyColumn, boolean multipleSelection, String whereClause, boolean lookup) + public InfoGeneralPanel(String queryValue, int windowNo,String tableName,String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, GridField field) { super(windowNo, tableName, keyColumn, multipleSelection, whereClause, lookup, 0, queryValue); + setGridfield(field); setTitle(Msg.getMsg(Env.getCtx(), "Info")); try @@ -314,11 +317,20 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener return false; // Prepare table + StringBuilder where = new StringBuilder(); + if(m_gridfield != null) { + MReference ref = m_gridfield.getAD_Reference_Value_ID() > 0 ? MReference.get(Env.getCtx(), m_gridfield.getAD_Reference_Value_ID()) : null; + if(ref == null || !ref.isShowInactiveRecords()) { + + where = new StringBuilder(p_tableName).append(".").append("IsActive='Y'"); + } + } - StringBuilder where = new StringBuilder(p_tableName).append(".").append("IsActive='Y'"); - - if (p_whereClause.length() > 0) - where.append(" AND (").append(p_whereClause).append(")"); + if (p_whereClause.length() > 0) { + if(where.length() > 0) + where.append(" AND "); + where.append(" (").append(p_whereClause).append(")"); + } prepareTable(m_generalLayout, p_tableName, where.toString(), "2"); contentPanel.repaint();