Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Obtener valor por defecto del campo Usuario en ventana Requisición #51

Open
EdwinBetanc0urt opened this issue Aug 11, 2022 · 0 comments

Comments

@EdwinBetanc0urt
Copy link
Member

EdwinBetanc0urt commented Aug 11, 2022

Al colocar la columna Supervisor_ID como identificador en al tabla AD_User, se genera un error sql al tratar de obtener el valor por defecto del campo Usuario en la ventana Requisición (lo mismo al listar los registros de ese campo).

Petición:

http://localhost:8085/api/adempiere/user-interface/window/default-value?field_uuid=8d0a632a-fb40-11e8-a479-7a0060f0aa01&id=10028&value=100&token=ca853590-5415-4b10-944d-7d3c82538533&language=en

Respuesta:

{
  "code": 500,
  "result": "org.postgresql.util.PSQLException: ERROR: syntax error at or near \")\" Position: 78"
}

Consulta SQL generada:

SELECT AD_User.AD_User_ID,NULL,
	COALESCE(AD_User.Name,'-1') ||'_'|| COALESCE((),'-1'),
	AD_User.IsActive 
FROM AD_User 

WHERE 
	AD_User.AD_User_ID=100 

	AND AD_User.AD_Client_ID IN(0,11) 
	AND AD_User.AD_Org_ID IN(0,11,12,50000,50002,50001,50004,50006,50005,50007) 
	AND (
		AD_User.AD_User_ID IS NULL 
		OR AD_User.AD_User_ID NOT IN ( 
			SELECT Record_ID FROM AD_Private_Access 
			WHERE AD_Table_ID = 114 AND AD_User_ID <> 100 AND IsActive = 'Y' 
		)
	)

Depuración Eclipse

El objeto MLookupInfo generado con MLookupFactory.getLookupInfo de la en la clase:

https://github.com/solop-develop/backend/blob/experimental/src/main/java/org/spin/base/util/ReferenceUtil.java#L140

Screenshot_20220811_150234

===========> MLookupFactory.getLookup_TableDirEmbed: No Identifier records found: Supervisor_ID [34]
Log al visualizar en la interfaz Zk:
===========> MLookup.getDirect: AD_User.AD_User_ID: SQL=SELECT AD_User.AD_User_ID,NULL,NVL(AD_User.Name,'-1') ||'_'|| NVL((),'-1'),AD_User.IsActive FROM AD_User WHERE AD_User.AD_User_ID=?; Key=102 [260]
org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
  Position: 78; State=42601; ErrorCode=0
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2674)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2364)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:354)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:484)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:404)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:162)
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.compiere.db.StatementProxy.invoke(StatementProxy.java:100)
	at com.sun.proxy.$Proxy5.executeQuery(Unknown Source)
	at org.compiere.model.MLookup.getDirect(MLookup.java:473)
	at org.adempiere.webui.editor.WTableDirEditor.refreshList(WTableDirEditor.java:296)
	at org.adempiere.webui.editor.WTableDirEditor.setValue(WTableDirEditor.java:197)
	at org.adempiere.webui.editor.WTableDirEditor.propertyChange(WTableDirEditor.java:420)
	at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
	at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
	at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
	at org.compiere.model.GridField.setValue(GridField.java:1509)
	at org.compiere.model.GridTab.setCurrentRow(GridTab.java:2335)
	at org.compiere.model.GridTab.dataRefresh(GridTab.java:974)
	at org.compiere.model.GridTab.dataRefresh(GridTab.java:953)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant