From 60fb790b1789a4bae24b23bba88daf5ddc08f84e Mon Sep 17 00:00:00 2001 From: Layda Salas Date: Fri, 4 Mar 2022 02:52:28 +0100 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-2081=20Class=20OrderLineCreateProduct?= =?UTF-8?q?ion=20and=20OrderLineCreateShi=E2=80=A6=20(#1211)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! #resolve #fixversion 10 * IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! #resolve #fixversion 10 * IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! #resolve #fixversion 10 --- .../iD10/oracle/202203020949_IDEMPIERE-2081.sql | 10 ++++++++++ .../postgresql/202203020949_IDEMPIERE-2081.sql | 7 +++++++ .../process/OrderLineCreateProduction.java | 14 +++++++------- 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 migration/iD10/oracle/202203020949_IDEMPIERE-2081.sql create mode 100644 migration/iD10/postgresql/202203020949_IDEMPIERE-2081.sql diff --git a/migration/iD10/oracle/202203020949_IDEMPIERE-2081.sql b/migration/iD10/oracle/202203020949_IDEMPIERE-2081.sql new file mode 100644 index 0000000000..a40e1148be --- /dev/null +++ b/migration/iD10/oracle/202203020949_IDEMPIERE-2081.sql @@ -0,0 +1,10 @@ +-- IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! +SELECT register_migration_script('202203020949_IDEMPIERE-2081.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Mar 2, 2022, 9:49:04 AM CET +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 ('I','Production has already been created: {0}',0,0,'Y',TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,200732,'ProductionHasAlreadyBeenCreated','D','273dde9a-5130-46d0-9d98-25c241597035') +; + diff --git a/migration/iD10/postgresql/202203020949_IDEMPIERE-2081.sql b/migration/iD10/postgresql/202203020949_IDEMPIERE-2081.sql new file mode 100644 index 0000000000..51f51ffd73 --- /dev/null +++ b/migration/iD10/postgresql/202203020949_IDEMPIERE-2081.sql @@ -0,0 +1,7 @@ +-- IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! +SELECT register_migration_script('202203020949_IDEMPIERE-2081.sql') FROM dual; + +-- Mar 2, 2022, 9:49:04 AM CET +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 ('I','Production has already been created: {0}',0,0,'Y',TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,200732,'ProductionHasAlreadyBeenCreated','D','273dde9a-5130-46d0-9d98-25c241597035') +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java b/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java index c29c9a8e9c..12e9eb8258 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java @@ -79,22 +79,21 @@ public class OrderLineCreateProduction extends SvrProcess { if (log.isLoggable(Level.INFO)) log.info("C_OrderLine_ID=" + p_C_OrderLine_ID ); if (p_C_OrderLine_ID == 0) - throw new IllegalArgumentException("No OrderLine"); + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "No OrderLine")); // MOrderLine line = new MOrderLine (getCtx(), p_C_OrderLine_ID, get_TrxName()); if (line.get_ID() == 0) - throw new IllegalArgumentException("Order line not found"); + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "Order line not found")); MOrder order = new MOrder (getCtx(), line.getC_Order_ID(), get_TrxName()); if (!MOrder.DOCSTATUS_Completed.equals(order.getDocStatus())) - throw new IllegalArgumentException("Order not completed"); - + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "Order not completed")); MDocType doc = new MDocType(getCtx(), order.getC_DocType_ID(), get_TrxName()); if ( (line.getQtyOrdered().subtract(line.getQtyDelivered())).compareTo(Env.ZERO) <= 0 ) { if (!doc.getDocSubTypeSO().equals("ON")) //Consignment and stock orders both have subtype of ON - { - return "Ordered quantity already shipped"; + { + return Msg.getMsg(Env.getCtx(), "Ordered quantity already shipped"); } } @@ -109,7 +108,8 @@ public class OrderLineCreateProduction extends SvrProcess p_C_OrderLine_ID); if (docNo != null) { - throw new IllegalArgumentException("Production has already been created: " + docNo); + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "ProductionHasAlreadyBeenCreated", new String[] {docNo})); + } }