IDEMPIERE-1376 Error message not translated in Validate Business Partner (#45)

This commit is contained in:
Diego Ruiz 2020-05-09 15:40:27 +02:00 committed by GitHub
parent 1f3a83c96e
commit 4c22d862be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 4 deletions

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-1376 Error message not translated in Validate Business Partner
-- May 9, 2020, 1:29:48 PM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','No Business Partner/Group selected',0,0,'Y',TO_DATE('2020-05-09 13:29:48','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2020-05-09 13:29:48','YYYY-MM-DD HH24:MI:SS'),100,200613,'BPartnerGroupNotSelected','D','83b41219-8ef2-4a58-87f0-bca896cdb8f8')
;
SELECT register_migration_script('202005091335_IDEMPIERE-1376.sql') FROM dual
;

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-1376 Error message not translated in Validate Business Partner
-- May 9, 2020, 1:29:48 PM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','No Business Partner/Group selected',0,0,'Y',TO_DATE('2020-05-09 13:29:48','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2020-05-09 13:29:48','YYYY-MM-DD HH24:MI:SS'),100,200613,'BPartnerGroupNotSelected','D','83b41219-8ef2-4a58-87f0-bca896cdb8f8')
;
SELECT register_migration_script('202005091335_IDEMPIERE-1376.sql') FROM dual
;

View File

@ -27,6 +27,7 @@ import org.compiere.model.MRole;
import org.compiere.model.MRoleOrgAccess;
import org.compiere.model.MWarehouse;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.Msg;
/**
* Link Business Partner to Organization.
@ -85,7 +86,7 @@ public class BPartnerOrgLink extends SvrProcess
throw new AdempiereUserError ("No Business Partner ID");
MBPartner bp = new MBPartner (getCtx(), p_C_BPartner_ID, get_TrxName());
if (bp.get_ID() == 0)
throw new AdempiereUserError ("Business Partner not found - C_BPartner_ID=" + p_C_BPartner_ID);
throw new AdempiereUserError (Msg.getMsg(getCtx(), "BPartnerNotFound") + " - C_BPartner_ID=" + p_C_BPartner_ID);
// BP Location
MBPartnerLocation[] locs = bp.getLocations(false);
if (locs == null || locs.length == 0)

View File

@ -20,6 +20,8 @@ import java.math.BigDecimal;
import java.util.logging.Level;
import org.compiere.model.MBPartner;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.Msg;
/**
* UnLink Business Partner from Organization
@ -62,7 +64,7 @@ public class BPartnerOrgUnLink extends SvrProcess
throw new IllegalArgumentException ("No Business Partner ID");
MBPartner bp = new MBPartner (getCtx(), p_C_BPartner_ID, get_TrxName());
if (bp.get_ID() == 0)
throw new IllegalArgumentException ("Business Partner not found - C_BPartner_ID=" + p_C_BPartner_ID);
throw new AdempiereUserError (Msg.getMsg(getCtx(), "BPartnerNotFound") + " - C_BPartner_ID=" + p_C_BPartner_ID);
//
if (bp.getAD_OrgBP_ID() == 0)
throw new IllegalArgumentException ("Business Partner not linked to an Organization");

View File

@ -74,13 +74,13 @@ public class BPartnerValidate extends SvrProcess
{
if (log.isLoggable(Level.INFO)) log.info("C_BPartner_ID=" + p_C_BPartner_ID + ", C_BP_Group_ID=" + p_C_BP_Group_ID);
if (p_C_BPartner_ID == 0 && p_C_BP_Group_ID == 0)
throw new AdempiereUserError ("No Business Partner/Group selected");
throw new AdempiereUserError (Msg.getMsg(getCtx(), "BPartnerGroupNotSelected"));
if (p_C_BP_Group_ID == 0)
{
MBPartner bp = new MBPartner (getCtx(), p_C_BPartner_ID, get_TrxName());
if (bp.get_ID() == 0)
throw new AdempiereUserError ("Business Partner not found - C_BPartner_ID=" + p_C_BPartner_ID);
throw new AdempiereUserError (Msg.getMsg(getCtx(), "BPartnerNotFound") + " - C_BPartner_ID=" + p_C_BPartner_ID);
checkBP (bp);
}
else