From 26d2e37339a4faee7efc1aae3f72da61d1f18bee Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 22 Jul 2020 09:22:23 +0200 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-1848=20can=20delete=20org,=20account?= =?UTF-8?q?=20record=20in=20"Account=20Schema=20Dime=E2=80=A6=20(#150)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-1848 can delete org, account record in "Account Schema Dimensions" Set Accounting Schema > Account Schema Dimensions > Element Type readonly when the type is Account or Org * IDEMPIERE-1848 can delete org, account record in "Account Schema Dimensions" reverting https://github.com/idempiere/idempiere/commit/be8de78 from https://sourceforge.net/p/adempiere/bugs/773/ --- .../compiere/model/MAcctSchemaElement.java | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java index 314b4aa6ba..6b8f22cd6e 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java @@ -35,20 +35,15 @@ import org.compiere.util.Msg; * @author Jorg Janke * @version $Id: MAcctSchemaElement.java,v 1.4 2006/08/10 01:00:44 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - *
  • BF [ 1795817 ] Acct Schema Elements "Account" and "Org" should be mandatory * @author victor.perez@e-evolution.com, www.e-evolution.com *
  • RF [ 2214883 ] Remove SQL code and Replace for Query http://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335 */ public class MAcctSchemaElement extends X_C_AcctSchema_Element { - - - /** - * - */ - private static final long serialVersionUID = 4215184252533527719L; - + /** + * + */ + private static final long serialVersionUID = -4642928142654938659L; /** * Factory: Return ArrayList of Account Schema Elements @@ -429,14 +424,6 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element (ELEMENTTYPE_UserElementList1.equals(et) || ELEMENTTYPE_UserElementList2.equals(et) || ELEMENTTYPE_UserColumn1.equals(et) || ELEMENTTYPE_UserColumn2.equals(et))) setIsMandatory(false); - // Acct Schema Elements "Account" and "Org" should be mandatory - teo_sarca BF [ 1795817 ] - if (ELEMENTTYPE_Account.equals(et) || ELEMENTTYPE_Organization.equals(et)) { - if (!isMandatory()) - setIsMandatory(true); - if (!isActive()) - setIsActive(true); - } - // else if (isMandatory()) { String errorField = null; @@ -533,19 +520,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element StringBuilder msguvd = new StringBuilder(element).append("=").append(id); MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName()); } // updateData - - @Override - protected boolean beforeDelete () - { - String et = getElementType(); - // Acct Schema Elements "Account" and "Org" should be mandatory - teo_sarca BF [ 1795817 ] - if (ELEMENTTYPE_Account.equals(et) || ELEMENTTYPE_Organization.equals(et)) { - log.saveError("Error", Msg.parseTranslation(getCtx(), "@DeleteError@ @IsMandatory@")); - return false; - } - return true; - } - + /** * After Delete * @param success success