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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030800
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2015-09-09 12:282015-11-23 21:16
ReporteryogaskarnikView Statuspublic 
Assigned Tocaristu 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q1
StatusclosedFix in branchFixed in SCM revision92802596bf94
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0PR15Q2.4SCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0030800: Filter on Property field in a table reference column doesn't work

DescriptionGrid Filtering for a compound property field which base entity is a Table reference in the main entity it is not working.

It tries to filter by the table's displayed column instead of by the correct property.
Steps To Reproduce1. Setup steps
1.1 As system admin
1.2 Open Window, Tabs and Fields
1.3 Open Sales Order, Header tab
1.4 Add a new Field:
  * Name: sales rep
  * Property: salesRepresentative.email
  * Show in Grid View: true

2. Reproduce steps
2.1 Login to ERP
2.2 Open Sales Order
2.3 Create 2 orders with different sales representatives
2.4 In grid view, clear filters (to ensure following filtering will be done in backend)
2.5 Filter by the email of one of these sales representatives
  -> * Grid shows no data
     * Debugging the query to get data it is:
       Order ... left join e.salesRepresentative as join_3 where (( upper(e.salesRepresentative.name) like upper(:alias_0) escape '|'))

Note it is trying to filter by e.salesRepresentative.name instead of e.salesRepresentative.email

Note client (adaptive) filtering is working fine for this case
Proposed SolutionThe problem is caused by org.openbravo.service.json.AdvancedQueryBuilder.getPropertyForTableReference method which is replacing in this case the correct property path by the displayed column of the base table reference to try to solve issue 0026696. Ideally this substitution shouldn't be done in the server side but in client using fields displayProperty to create the correct criteria being in this manner unneeded to do the transformation.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00266963.0PR14Q4 closedshankarb The filter does not work when changing the ad_org_id column to a table reference displayng the value column. 
related to defect 00269503.0PR14Q3 closedAugustoMauch Reference filter in Columns tab is not working properly. 
related to defect 0031304 acknowledgedTriage Platform Base Behavior of summary functions with property fields pointing to table references is not correct 
related to defect 0031305 closedplatform NullPointerException when creating a new record on the header having a property field 
related to design defect 0031315 acknowledgedTriage Platform Base Equals other column filter is not working 
causes defect 0035426 closedinigosanchez Adaptive filtering capability does not work for Table references. 

-  Notes
(0080280)
alostale (manager)
2015-09-09 13:39

Please, provide more accurate description (what fails, is there any error...) and steps to reproduce (what does "foreign key field in Sales Order with a List reference" mean?) indicating the exact steps rather than generic ones.
(0080873)
yogaskarnik (viewer)
2015-10-08 06:18

Waiting for access to the environment so that we can analyze the logs.
(0081404)
caristu (developer)
2015-10-30 13:04

Summary of the Test Cases for the fix: https://docs.google.com/spreadsheets/d/1P5S8vXmyNZxdTiUOAosIFci9zmuanPVk0IjU5X99Ktg/edit#gid=0 [^]
(0081406)
hgbot (developer)
2015-10-30 13:09

Repository: erp/devel/pi
Changeset: 92802596bf940d3c62c8e84547ea21e78055c0fc
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Oct 30 13:08:22 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/92802596bf940d3c62c8e84547ea21e78055c0fc [^]

fixes issue 30800: Filter on Property field in a table ref column doesn't work
Now the value used to filter a column based on a table reference is set on the client. We make use an attribute called displayProperty which is only set for Table references. This way, the change is transparent for the rest of FK references.
By setting this value in the client, the replacement done in the server (in AvanceQueryBuilder.parseSimpleClause() method) is not needed anymore.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKComboUIDefinition.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
(0081427)
alostale (manager)
2015-11-02 12:45
edited on: 2015-11-02 12:50

code reviewed

Tested:
* It is possible to filter correctly
* The request sends the correct display field
  - for property fields
  - for table reference
  - for table dir reference
* Tested related issues:
  - 0026696
  - 0026950
* Additional test cases: https://docs.google.com/spreadsheets/d/1P5S8vXmyNZxdTiUOAosIFci9zmuanPVk0IjU5X99Ktg/edit#gid=0 [^]

(0082163)
hudsonbot (developer)
2015-11-23 21:16

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7b56bebaaa88 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-09-09 12:28 yogaskarnik New Issue
2015-09-09 12:28 yogaskarnik Assigned To => platform
2015-09-09 12:28 yogaskarnik Modules => Core
2015-09-09 12:28 yogaskarnik Resolution time => 1440712800
2015-09-09 12:28 yogaskarnik Triggers an Emergency Pack => No
2015-09-09 13:39 alostale Note Added: 0080280
2015-09-09 13:39 alostale Assigned To platform => yogaskarnik
2015-09-09 13:39 alostale Status new => feedback
2015-10-08 06:18 yogaskarnik Note Added: 0080873
2015-10-20 11:11 yogaskarnik Status feedback => new
2015-10-20 11:11 yogaskarnik Steps to Reproduce Updated View Revisions
2015-10-20 12:20 yogaskarnik Steps to Reproduce Updated View Revisions
2015-10-26 11:25 VictorVillar Assigned To yogaskarnik => platform
2015-10-26 14:29 alostale Relationship added related to 0026696
2015-10-26 14:30 alostale Relationship added related to 0026950
2015-10-26 15:23 alostale Summary Filter on Property field does not work => Filter on Property field in a table reference column doesn't work
2015-10-26 15:23 alostale Description Updated View Revisions
2015-10-26 15:23 alostale Steps to Reproduce Updated View Revisions
2015-10-26 15:23 alostale Status new => acknowledged
2015-10-26 15:27 alostale Proposed Solution updated
2015-10-26 15:30 alostale Steps to Reproduce Updated View Revisions
2015-10-26 15:31 alostale Status acknowledged => scheduled
2015-10-26 15:31 alostale Assigned To platform => caristu
2015-10-29 18:53 caristu Relationship added related to 0031304
2015-10-29 18:56 caristu Relationship added related to 0031305
2015-10-30 13:04 caristu Note Added: 0081404
2015-10-30 13:09 hgbot Checkin
2015-10-30 13:09 hgbot Note Added: 0081406
2015-10-30 13:09 hgbot Status scheduled => resolved
2015-10-30 13:09 hgbot Resolution open => fixed
2015-10-30 13:09 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/92802596bf940d3c62c8e84547ea21e78055c0fc [^]
2015-10-30 13:53 caristu Relationship added related to 0031315
2015-11-02 11:57 alostale Review Assigned To => alostale
2015-11-02 12:45 alostale Note Added: 0081427
2015-11-02 12:45 alostale Status resolved => closed
2015-11-02 12:45 alostale Fixed in Version => 3.0PR16Q1
2015-11-02 12:50 alostale Note Edited: 0081427 View Revisions
2015-11-23 21:16 hudsonbot Checkin
2015-11-23 21:16 hudsonbot Note Added: 0082163
2017-03-07 17:34 inigosanchez Relationship added causes 0035426


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker