diff --git a/migration/i3.1/oracle/201609031608_IDEMPIERE-2676.sql b/migration/i3.1/oracle/201609031608_IDEMPIERE-2676.sql new file mode 100644 index 0000000000..6a12179311 --- /dev/null +++ b/migration/i3.1/oracle/201609031608_IDEMPIERE-2676.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2676 Incorrect context variables - onNavigate Callout +-- Sep 3, 2016 3:07:56 PM GMT+01:00 +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceListReadOnly', IsUpdateable='N',Updated=TO_DATE('2016-09-03 15:07:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2161 +; + +-- Sep 3, 2016 3:08:09 PM GMT+01:00 +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceListReadOnly', IsUpdateable='N',Updated=TO_DATE('2016-09-03 15:08:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3484 +; + +SELECT register_migration_script('201609031608_IDEMPIERE-2676.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201609031608_IDEMPIERE-2676.sql b/migration/i3.1/postgresql/201609031608_IDEMPIERE-2676.sql new file mode 100644 index 0000000000..b9666ef6cb --- /dev/null +++ b/migration/i3.1/postgresql/201609031608_IDEMPIERE-2676.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-2676 Incorrect context variables - onNavigate Callout +-- Sep 3, 2016 3:07:56 PM GMT+01:00 +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceListReadOnly', IsUpdateable='N',Updated=TO_TIMESTAMP('2016-09-03 15:07:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2161 +; + +-- Sep 3, 2016 3:08:09 PM GMT+01:00 +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceListReadOnly', IsUpdateable='N',Updated=TO_TIMESTAMP('2016-09-03 15:08:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3484 +; + +SELECT register_migration_script('201609031608_IDEMPIERE-2676.sql') FROM dual +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 98303c4a85..670d252e26 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -661,9 +661,10 @@ public class CalloutOrder extends CalloutEngine * @param mTab Grid Tab * @param mField Grid Field * @param value New Value + * @param readonly Read Only - do not set tab fields, just context * @return null or error message */ - public String priceList (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + public String priceListFill (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, boolean readonly) { Integer M_PriceList_ID = (Integer) mTab.getValue("M_PriceList_ID"); if (M_PriceList_ID == null || M_PriceList_ID.intValue()== 0) @@ -695,12 +696,16 @@ public class CalloutOrder extends CalloutEngine if (rs.next()) { // Tax Included - mTab.setValue("IsTaxIncluded", new Boolean("Y".equals(rs.getString(1)))); + if (!readonly) { + mTab.setValue("IsTaxIncluded", new Boolean("Y".equals(rs.getString(1)))); + } // Price Limit Enforce Env.setContext(ctx, WindowNo, "EnforcePriceLimit", rs.getString(2)); // Currency - Integer ii = new Integer(rs.getInt(3)); - mTab.setValue("C_Currency_ID", ii); + if (!readonly) { + Integer ii = new Integer(rs.getInt(3)); + mTab.setValue("C_Currency_ID", ii); + } // PriceList Version Env.setContext(ctx, WindowNo, "M_PriceList_Version_ID", rs.getInt(5)); } @@ -718,8 +723,18 @@ public class CalloutOrder extends CalloutEngine if (steps) log.warning("fini"); return ""; + } // priceListFill + + public String priceList (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + { + return priceListFill (ctx, WindowNo, mTab, mField, value, false); } // priceList + /* IDEMPIERE-2676 - this is same callout priceList but not setting any variable, just reading and setting context, called on navigate */ + public String priceListReadOnly (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + { + return priceListFill (ctx, WindowNo, mTab, mField, value, true); + } // priceListReadOnly /** * Set Payment Term.