From 9001929ae1fd0af18668535962de59bc3f18fc54 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 18 Jan 2013 11:38:44 -0800 Subject: [PATCH] IDEMPIERE-567 Move ProductUOMConversionRateValidate sysconfig key to be client configurable --- .../oracle/201301181138_IDEMPIERE-567.sql | 13 +++++++++++++ .../postgresql/201301181138_IDEMPIERE-567.sql | 13 +++++++++++++ .../src/org/compiere/model/MUOMConversion.java | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 migration/i1.0a-release/oracle/201301181138_IDEMPIERE-567.sql create mode 100644 migration/i1.0a-release/postgresql/201301181138_IDEMPIERE-567.sql diff --git a/migration/i1.0a-release/oracle/201301181138_IDEMPIERE-567.sql b/migration/i1.0a-release/oracle/201301181138_IDEMPIERE-567.sql new file mode 100644 index 0000000000..56af0fc7b4 --- /dev/null +++ b/migration/i1.0a-release/oracle/201301181138_IDEMPIERE-567.sql @@ -0,0 +1,13 @@ +-- Jan 18, 2013 11:37:40 AM PST +-- IDEMPIERE-567 Move ProductUOMConversionRateValidate sysconfig key to be client configurable +UPDATE AD_SysConfig SET ConfigurationLevel='C',Updated=TO_DATE('2013-01-18 11:37:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SysConfig_ID=50023 +; + +-- Jan 18, 2013 11:37:44 AM PST +-- IDEMPIERE-567 Move ProductUOMConversionRateValidate sysconfig key to be client configurable +UPDATE AD_SysConfig SET ConfigurationLevel='C',Updated=TO_DATE('2013-01-18 11:37:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SysConfig_ID=50022 +; + +SELECT register_migration_script('201301181138_IDEMPIERE-567.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201301181138_IDEMPIERE-567.sql b/migration/i1.0a-release/postgresql/201301181138_IDEMPIERE-567.sql new file mode 100644 index 0000000000..ac7905ebe9 --- /dev/null +++ b/migration/i1.0a-release/postgresql/201301181138_IDEMPIERE-567.sql @@ -0,0 +1,13 @@ +-- Jan 18, 2013 11:37:40 AM PST +-- IDEMPIERE-567 Move ProductUOMConversionRateValidate sysconfig key to be client configurable +UPDATE AD_SysConfig SET ConfigurationLevel='C',Updated=TO_TIMESTAMP('2013-01-18 11:37:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SysConfig_ID=50023 +; + +-- Jan 18, 2013 11:37:44 AM PST +-- IDEMPIERE-567 Move ProductUOMConversionRateValidate sysconfig key to be client configurable +UPDATE AD_SysConfig SET ConfigurationLevel='C',Updated=TO_TIMESTAMP('2013-01-18 11:37:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SysConfig_ID=50022 +; + +SELECT register_migration_script('201301181138_IDEMPIERE-567.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java index 58ad43206e..0daa34a608 100644 --- a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java +++ b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java @@ -702,7 +702,7 @@ public class MUOMConversion extends X_C_UOM_Conversion return false; } // Enforce Product UOM - if (MSysConfig.getBooleanValue(MSysConfig.ProductUOMConversionUOMValidate, true)) + if (MSysConfig.getBooleanValue(MSysConfig.ProductUOMConversionUOMValidate, true, getAD_Client_ID())) { if (getM_Product_ID() != 0 && (newRecord || is_ValueChanged("M_Product_ID"))) @@ -718,7 +718,7 @@ public class MUOMConversion extends X_C_UOM_Conversion } // The Product UoM needs to be the smallest UoM - Multiplier must be < 0; Divider must be > 0 - if (MSysConfig.getBooleanValue(MSysConfig.ProductUOMConversionRateValidate, true)) + if (MSysConfig.getBooleanValue(MSysConfig.ProductUOMConversionRateValidate, true, getAD_Client_ID())) { if (getM_Product_ID() != 0 && getDivideRate().compareTo(Env.ONE) < 0) {