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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038734
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajoralways2018-06-11 18:412022-02-01 08:08
ReporterdmiguelezView Statuspublic 
Assigned ToTriage Platform Base 
PriorityurgentResolutionopenFixed 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

0038734: Default Expression of Field in OBUISEL_Selector definition is mixing js and hql expressions, and is not working in all scenarios

DescriptionDefault Expression of Field in OBUISEL_Selector definition is mixing js and hql expressions, and is not working in all scenarios.

This default expression is used to pre-filter fields in a grid, which is done using a js expression. But it is also used in the hql created for the drop down list. js and hql expressions can class in some cases.
Steps To ReproduceAs System Admin

Go to Reference window and look for one named Product Complete.
Move to Defined Selector || Defined Selector field Tab
Look for the field named Quantity on Hand.
In the Default Expression field put: '>0'

Change Role to F&B Admin

Go to Goods Shipment Window. Create a header.
Move to lines and click on the Product selector.
Clicking on the magnifying glass works, the expression >0 is used to pre-filter the grid.

Clicking on the arrow for the drop down list throws this error in the log:
4026063 [http-bio-8080-exec-3] ERROR org.hibernate.hql.PARSER - line 1:982: unexpected token: >
4026064 [http-bio-8080-exec-3] ERROR org.openbravo.service.json.DefaultJsonDataService - Exception when creating query select e from ProductStockView as e left join e.product as join_0 where ( ( e.organization in ('0','097E2B5F86394085B84832391860905E','E70BD74CE0E4432D9A8B22C43B12CD4C','BF67B59606F643E08CCC51A1CD93ECD5','B9BA55A1633440C4B8BAB5A66A569A10') ) and (e.active='Y' and ( ('169' in ('800051', '800052', '800096') and e.product.production = true and e.stocked = false) or ('169' in ('800053', 'FF808181323E504701323E57E08D0017') and e.product.production = true) or ('169' in ('170') and e.product.stocked = true) or ('169' in ('800092') and e.product.purchase = true) or ('169' in ('169') and (e.warehouse.id is null or e.warehouse.id in (select ow.warehouse.id from OrganizationWarehouse ow where ow.organization.id = 'BF67B59606F643E08CCC51A1CD93ECD5'))) or '169' not in ('800051', '800052', '800053', 'FF808181323E504701323E57E08D0017', '800096','170','800092','169')) and e.storageBin.warehouse.id = 'F7E634AE3D904FE6B8503D604ED2C5B5' and e.stocked = true and e.quantityOnHand = >0) ) and e.client.id in (:_dal_readableClients_dal_) and e.active='Y' order by join_0.name,join_0.id
org.openbravo.base.exception.OBException: Exception when creating query select e from ProductStockView as e left join e.product as join_0 where ( ( e.organization in ('0','097E2B5F86394085B84832391860905E','E70BD74CE0E4432D9A8B22C43B12CD4C','BF67B59606F643E08CCC51A1CD93ECD5','B9BA55A1633440C4B8BAB5A66A569A10') ) and (e.active='Y' and ( ('169' in ('800051', '800052', '800096') and e.product.production = true and e.stocked = false) or ('169' in ('800053', 'FF808181323E504701323E57E08D0017') and e.product.production = true) or ('169' in ('170') and e.product.stocked = true) or ('169' in ('800092') and e.product.purchase = true) or ('169' in ('169') and (e.warehouse.id is null or e.warehouse.id in (select ow.warehouse.id from OrganizationWarehouse ow where ow.organization.id = 'BF67B59606F643E08CCC51A1CD93ECD5'))) or '169' not in ('800051', '800052', '800053', 'FF808181323E504701323E57E08D0017', '800096','170','800092','169')) and e.storageBin.warehouse.id = 'F7E634AE3D904FE6B8503D604ED2C5B5' and e.stocked = true and e.quantityOnHand = >0) ) and e.client.id in (:_dal_readableClients_dal_) and e.active='Y' order by join_0.name,join_0.id
    at org.openbravo.dal.service.OBQuery.createQuery(OBQuery.java:266)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0038596 closedvmromanos Modules Show available quantity in Product selector in Distribution order Issue Window 

-  Notes
(0105092)
caristu (developer)
2018-06-12 13:07
edited on: 2018-06-12 13:11

Indeed, Default Selector Field Expressions are used by two different components, with different purposes. That explains why they are interpreted in a different way depending on the case:

- SelectorDataSourceFilter (selector drop-down): to compute the HQL where and filter clause.
- SelectorDefaultFilterActionHandler (selector pop-up): generates the JS expressions that will be applied into the pop-up. Smartclient will transform them into the corresponding criterias.

According to the documentation[1] these are JS expressions, so it seems that the component that is not using them properly is the SelectorDataSourceFilter.

[1] http://wiki.openbravo.com/wiki/Projects:Selector/Default_Filter_Expressions#Default_Expression_at_Selector_Field_level [^]


- Issue History
Date Modified Username Field Change
2018-06-11 18:41 dmiguelez New Issue
2018-06-11 18:41 dmiguelez Assigned To => platform
2018-06-11 18:41 dmiguelez Modules => Core
2018-06-11 18:41 dmiguelez Triggers an Emergency Pack => No
2018-06-11 18:42 dmiguelez Steps to Reproduce Updated View Revisions
2018-06-11 18:43 dmiguelez Relationship added related to 0038596
2018-06-12 13:07 caristu Note Added: 0105092
2018-06-12 13:10 caristu Note Edited: 0105092 View Revisions
2018-06-12 13:11 caristu Note Edited: 0105092 View Revisions
2022-02-01 08:08 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker