Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039214
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] 00. Application dictionarymajoralways2018-09-03 11:172022-02-01 08:07
ReporterdmiguelezView Statuspublic 
Assigned ToTriage Platform Base 
PriorityhighResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0039214: Allow to use replacements in WhereClause of Tab definitions when the Table is defined as an HQL query

DescriptionWhen there is a Table defined through AD as an HQL Query, it is possible to create a Window and a Tab over this Table.

However, in the Where Clause of the Tab, the expressions that use replacements (like @ad_client_id@) are not working for this scenario
Steps To ReproduceApply this patch and compile the application updating the database:

diff --git a/src-db/database/sourcedata/AD_TAB.xml b/src-db/database/sourcedata/AD_TAB.xml
--- a/src-db/database/sourcedata/AD_TAB.xml
+++ b/src-db/database/sourcedata/AD_TAB.xml
@@ -15986,6 +15986,7 @@
 <!--652123A308954FE8AA072DE90EE7C988--> <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
 <!--652123A308954FE8AA072DE90EE7C988--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--652123A308954FE8AA072DE90EE7C988--> <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--652123A308954FE8AA072DE90EE7C988--> <HQLWHERECLAUSE><![CDATA[(olpr.client.id = @ad_client_id@)]]></HQLWHERECLAUSE>
 <!--652123A308954FE8AA072DE90EE7C988--> <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--652123A308954FE8AA072DE90EE7C988--> <DISPLAYLOGIC><![CDATA[@HASRELATEDSERVICE@='Y']]></DISPLAYLOGIC>
 <!--652123A308954FE8AA072DE90EE7C988--> <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>


Log in as F&B Admin

Go to Product Window and create a new record with:
  - Organization: *
  - Search Key: Test
  - Name: Test
  - Product Type: Service
  - Linked to Product: Yes
  - Included Product Categories: All excluding defined
  - Included Products: All excluding defined
  - Quantity Rule: As per product
  - Proposal Type: Mandatory proposal
Move to Price Tab and create a new record with:
  - Price List version: Tarifa de ventas
  - Unit Price: 10
  - List Price: 10

Go to Sales Order window and create a new record with:
  - Organization: F&B España - Región Norte
  - Business Partner: Alimentos y Supermercados
Move to lines tab and create a new record with:
  - Product: Agua Sin Gas
  - Ordered Quantity: 10
Create another line with:
  - Product: Test
  - Operative Quantity: 10
Click on select order line button and select the previous line (Agua Sin Gas)

Move to the Tab Related products.

Check and error is raised, and the log shows:

128275 [http-bio-8080-exec-9] ERROR org.openbravo.service.datasource.DataSourceServlet - org.hibernate.QueryException: unexpected char: '@' [select olpr.id, olpr.salesOrderLine, olpr.orderlineRelated, so.documentNo, sol.lineNo, sol.product, at as attributeSetValue, olpr.amount, olpr.quantity from OrderlineServiceRelation olpr join olpr.salesOrderLine as sol join sol.salesOrder as so left join sol.attributeSetValue as at WHERE olpr.client.id in ('0', '23C59575B9CF467C9620760EB255B389') AND olpr.organization in ('0','E443A31992CB4635AFCAEABE7183CE85','B843C30461EA4501935CB1D125C9C25A','BAE22373FEBE4CCCA24517E23F0C8A48','DC206C91AA6A4897B44DA897936E0EC3','19404EAD144C49A0AF37D54377CF452D','2E60544D37534C0B89E765FE29BC0B43','7BABA5FF80494CAFA54DEBD22EC46F01') AND (( olpr.orderlineRelated.id = :alias_0 )) AND (olpr.client.id = @ad_client_id@) ORDER BY sol.lineNo, olpr.id]
java.lang.IllegalArgumentException: org.hibernate.QueryException: unexpected char: '@' [select olpr.id, olpr.salesOrderLine, olpr.orderlineRelated, so.documentNo, sol.lineNo, sol.product, at as attributeSetValue, olpr.amount, olpr.quantity from OrderlineServiceRelation olpr join olpr.salesOrderLine as sol join sol.salesOrder as so left join sol.attributeSetValue as at WHERE olpr.client.id in ('0', '23C59575B9CF467C9620760EB255B389') AND olpr.organization in ('0','E443A31992CB4635AFCAEABE7183CE85','B843C30461EA4501935CB1D125C9C25A','BAE22373FEBE4CCCA24517E23F0C8A48','DC206C91AA6A4897B44DA897936E0EC3','19404EAD144C49A0AF37D54377CF452D','2E60544D37534C0B89E765FE29BC0B43','7BABA5FF80494CAFA54DEBD22EC46F01') AND (( olpr.orderlineRelated.id = :alias_0 )) AND (olpr.client.id = @ad_client_id@) ORDER BY sol.lineNo, olpr.id]
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:133)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164)
    at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:715)
    at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:731)
    at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:105)
    at org.openbravo.service.datasource.HQLDataSourceService.getQuery(HQLDataSourceService.java:358)
    at org.openbravo.service.datasource.HQLDataSourceService.getData(HQLDataSourceService.java:186)
    at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetchJSONObject(ReadOnlyDataSourceService.java:146)
    at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetch(ReadOnlyDataSourceService.java:74)
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:289)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:842)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0106657)
caristu (developer)
2018-09-10 12:28

Note that HQLInserters most probably can be used as a workaround for this feature request: http://wiki.openbravo.com/wiki/How_to_create_a_HQL_Based_Table#HQL_Inserters [^]

- Issue History
Date Modified Username Field Change
2018-09-03 11:17 dmiguelez New Issue
2018-09-03 11:17 dmiguelez Assigned To => platform
2018-09-03 11:17 dmiguelez Modules => Core
2018-09-03 11:17 dmiguelez Triggers an Emergency Pack => No
2018-09-10 12:28 caristu Note Added: 0106657
2022-02-01 08:07 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker