Use of virtual column in search is broken

Description

Hi,

Following :

Steps to reproduce :
Add a virtual column and try to use it with the Find panel.
In my case, i added a column (X_UserCountry_ID) which display the country of the user location.
(SELECT C_Country_ID from C_Location WHERE C_Location_ID=AD_User.C_Location_ID)

It will return 0 record and give following errors :

X_UserCountry_ID<>=<>102<><>AND<><>
19 sept. 2014 19:14:24 org.compiere.model.MRole addAccessSQL
GRAVE: TableName not correctly parsed - TableNameIn=AD_User - AccessSqlParser[|AD_User=WHERE|1] - #1 AD_User=WHERE
= SELECT AD_User_ID,Password,Supervisor_ID,C_BPartner_ID,Processing,EMailUser,EMailUserPW,C_Greeting_ID,Birthday,C_BPartner_Location_ID,LastResult,LastContact,Title,AD_OrgTrx_ID,EMailVerify,LDAPUser,EMailVerifyDate,NotificationType,IsFullBPAccess,UserPIN,IsInPayroll,AD_User_UU,Salt,IsSalesLead,IsMenuAutoExpand,IsLocked,DateAccountLocked,FailedLoginCount,DatePasswordChanged,DateLastLogin,IsNoPasswordReset,IsExpired,SecurityQuestion,Answer,AD_Client_ID,AD_Org_ID,IsActive,Value,Name,Description,Phone,Phone2,EMail,Fax,C_Location_ID,BPName,BP_Location_ID,C_Job_ID,C_Campaign_ID,SalesRep_ID,LeadSource,LeadSourceDescription,LeadStatus,LeadStatusDescription,Comments,((SELECT C_Country_ID from C_Location WHERE C_Location_ID=AD_User.C_Location_ID)) AS X_UserCountry_ID,Created,CreatedBy,Updated,UpdatedBy FROM AD_User WHERE ((AD_User.IsSalesLead='Y') AND (((AD_User.IsSalesLead='Y') AND ((AD_User.SELECT C_Country_ID from C_Location WHERE C_Location_ID=AD_User.C_Location_ID))=102)))
19 sept. 2014 19:14:24 org.compiere.model.MRole addAccessSQL
GRAVE: TableName not correctly parsed - TableNameIn=AD_User - AccessSqlParser[AD_User=WHERE|0] - #1 AD_User=WHERE
= SELECT COUNT FROM AD_User WHERE ((AD_User.IsSalesLead='Y') AND (((AD_User.IsSalesLead='Y') AND ((AD_User.SELECT C_Country_ID from C_Location WHERE C_Location_ID=AD_User.C_Location_ID))=102)))
19 sept. 2014 19:14:24 org.compiere.model.GridTable$Loader open
GRAVE: Count SQL=SELECT COUNT FROM AD_User WHERE ((AD_User.IsSalesLead='Y') AND (((AD_User.IsSalesLead='Y') AND ((AD_User.SELECT C_Country_ID from C_Location WHERE C_Location_ID=AD_User.C_Location_ID))=102))) AND AD_User.AD_Client_ID IN (0,1000000) AND (WHERE.AD_User_ID IS NULL OR WHERE.AD_User_ID NOT IN ( SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID = 114 AND AD_User_ID <> 1000002 AND IsActive = 'Y' ))
java.sql.SQLSyntaxErrorException: ORA-01747: spécification utilisateur.table.colonne, table.colonne ou colonne non valide

What is not correct : AD_User.SELECT C_Country_ID

Note that the virtual column can still be used in reports

Thanks

Nicolas

Environment

None
Fixed

Assignee

Carlos Ruiz

Reporter

Nicolas Micoud

Labels

None

Tested By

None

Priority

Major