IDEMPIERE-1848 can delete org, account record in "Account Schema Dime… (#150)
* 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/
This commit is contained in:
parent
be063cbd1e
commit
26d2e37339
|
@ -35,20 +35,15 @@ import org.compiere.util.Msg;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: MAcctSchemaElement.java,v 1.4 2006/08/10 01:00:44 jjanke Exp $
|
* @version $Id: MAcctSchemaElement.java,v 1.4 2006/08/10 01:00:44 jjanke Exp $
|
||||||
*
|
*
|
||||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
|
||||||
* <li>BF [ 1795817 ] Acct Schema Elements "Account" and "Org" should be mandatory
|
|
||||||
* @author victor.perez@e-evolution.com, www.e-evolution.com
|
* @author victor.perez@e-evolution.com, www.e-evolution.com
|
||||||
* <li>RF [ 2214883 ] Remove SQL code and Replace for Query http://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
|
* <li>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
|
public class MAcctSchemaElement extends X_C_AcctSchema_Element
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
/**
|
*/
|
||||||
*
|
private static final long serialVersionUID = -4642928142654938659L;
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 4215184252533527719L;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory: Return ArrayList of Account Schema Elements
|
* 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_UserElementList1.equals(et) || ELEMENTTYPE_UserElementList2.equals(et)
|
||||||
|| ELEMENTTYPE_UserColumn1.equals(et) || ELEMENTTYPE_UserColumn2.equals(et)))
|
|| ELEMENTTYPE_UserColumn1.equals(et) || ELEMENTTYPE_UserColumn2.equals(et)))
|
||||||
setIsMandatory(false);
|
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())
|
else if (isMandatory())
|
||||||
{
|
{
|
||||||
String errorField = null;
|
String errorField = null;
|
||||||
|
@ -533,19 +520,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element
|
||||||
StringBuilder msguvd = new StringBuilder(element).append("=").append(id);
|
StringBuilder msguvd = new StringBuilder(element).append("=").append(id);
|
||||||
MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName());
|
MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName());
|
||||||
} // updateData
|
} // 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
|
* After Delete
|
||||||
* @param success success
|
* @param success success
|
||||||
|
|
Loading…
Reference in New Issue