From df7de8087a57bbcea2af5ea40e2fb70f30d85d7a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 31 Mar 2017 18:10:05 +0200 Subject: [PATCH] IDEMPIERE-3330 Shipment Line - movement qty field not shown until qty is changed --- .../i4.1/oracle/201703311809_IDEMPIERE-3330.sql | 11 +++++++++++ .../postgresql/201703311809_IDEMPIERE-3330.sql | 8 ++++++++ .../src/org/compiere/model/CalloutInOut.java | 17 +++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 migration/i4.1/oracle/201703311809_IDEMPIERE-3330.sql create mode 100644 migration/i4.1/postgresql/201703311809_IDEMPIERE-3330.sql diff --git a/migration/i4.1/oracle/201703311809_IDEMPIERE-3330.sql b/migration/i4.1/oracle/201703311809_IDEMPIERE-3330.sql new file mode 100644 index 0000000000..b593e61503 --- /dev/null +++ b/migration/i4.1/oracle/201703311809_IDEMPIERE-3330.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3330 Shipment Line - movement qty field not shown until qty is changed +-- Mar 31, 2017 6:03:02 PM CEST +UPDATE AD_Column SET Callout='org.compiere.model.CalloutInOut.navigateInOutLine', IsUpdateable='N',Updated=TO_DATE('2017-03-31 18:03:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3529 +; + +SELECT register_migration_script('201703311809_IDEMPIERE-3330.sql') FROM dual +; + diff --git a/migration/i4.1/postgresql/201703311809_IDEMPIERE-3330.sql b/migration/i4.1/postgresql/201703311809_IDEMPIERE-3330.sql new file mode 100644 index 0000000000..2b9839faf2 --- /dev/null +++ b/migration/i4.1/postgresql/201703311809_IDEMPIERE-3330.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-3330 Shipment Line - movement qty field not shown until qty is changed +-- Mar 31, 2017 6:03:02 PM CEST +UPDATE AD_Column SET Callout='org.compiere.model.CalloutInOut.navigateInOutLine', IsUpdateable='N',Updated=TO_TIMESTAMP('2017-03-31 18:03:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3529 +; + +SELECT register_migration_script('201703311809_IDEMPIERE-3330.sql') FROM dual +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java index 6765e674dd..e2e847022a 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java @@ -719,4 +719,21 @@ public class CalloutInOut extends CalloutEngine return ""; } // asi + public String navigateInOutLine(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + { + if (isCalloutActive() || value == null) + return ""; + + int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID"); + // No Product + if (M_Product_ID != 0) { + MProduct product = MProduct.get(ctx, M_Product_ID); + int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); + boolean conversion = (C_UOM_To_ID != product.getC_UOM_ID()); + Env.setContext(ctx, WindowNo, "UOMConversion", conversion ? "Y" : "N"); + } + return ""; + } // navigateInOutLine + + } // CalloutInOut \ No newline at end of file