diff --git a/migration/i2.1/oracle/201412030938_IDEMPIERE-2342.sql b/migration/i2.1/oracle/201412030938_IDEMPIERE-2342.sql new file mode 100644 index 0000000000..2df80f07d6 --- /dev/null +++ b/migration/i2.1/oracle/201412030938_IDEMPIERE-2342.sql @@ -0,0 +1,14 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Dec 3, 2014 9:38:10 AM COT +-- IDEMPIERE-2342 SearchDefinition - query : could show record of other tenants +UPDATE AD_SearchDefinition SET Query='SELECT b.C_BPartner_ID FROM C_BPartner b +INNER JOIN AD_User u ON (b.C_BPartner_ID = u.C_BPartner_ID) +WHERE (UPPER(b.name) LIKE UPPER(?) OR UPPER(u.name) LIKE UPPER(?)) +AND b.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2014-12-03 09:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SearchDefinition_ID=50001 +; + +SELECT register_migration_script('201412030938_IDEMPIERE-2342.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201412030938_IDEMPIERE-2342.sql b/migration/i2.1/postgresql/201412030938_IDEMPIERE-2342.sql new file mode 100644 index 0000000000..433abcb8cd --- /dev/null +++ b/migration/i2.1/postgresql/201412030938_IDEMPIERE-2342.sql @@ -0,0 +1,11 @@ +-- Dec 3, 2014 9:38:10 AM COT +-- IDEMPIERE-2342 SearchDefinition - query : could show record of other tenants +UPDATE AD_SearchDefinition SET Query='SELECT b.C_BPartner_ID FROM C_BPartner b +INNER JOIN AD_User u ON (b.C_BPartner_ID = u.C_BPartner_ID) +WHERE (UPPER(b.name) LIKE UPPER(?) OR UPPER(u.name) LIKE UPPER(?)) +AND b.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2014-12-03 09:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SearchDefinition_ID=50001 +; + +SELECT register_migration_script('201412030938_IDEMPIERE-2342.sql') FROM dual +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java index 13ca738621..a6c49157e0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java @@ -144,7 +144,7 @@ public class DocumentSearchController implements EventListener{ } else { sql.append("WHERE UPPER(").append(column.getColumnName()).append(") LIKE UPPER(?)"); } - sql.append(" AND AD_Client_ID=@AD_Client_ID@ "); + sql.append(" AND AD_Client_ID=@#AD_Client_ID@ "); // search for a Integer if (msd.getDataType().equals(MSearchDefinition.DATATYPE_INTEGER)) {