Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023705Openbravo ERPA. Platformpublic2013-05-01 11:132013-05-07 15:43
alostale 
alostale 
immediatemajorhave not tried
closedfixed 
5
 
3.0MP233.0MP23 
shankarb
Core
Production - QA Approved
2013-03-04
https://code.openbravo.com/erp/devel/pi/rev/f9728bac00aa8157efca54574bed21f0104d8e07 [^]
Yes
0023705: Not possible to select a value in drop down filter
Drop down combos in grid filter are not populated when they link to a table which identifier is composed by, at least, a reference to another table that is translatable.

In this case when opening the combo "No items to show" message is always shown. Though it is still possible to filter by typing in the text field.

A cast exception is shown in the backend log:

d05203b3 217738 [http-8880-4] ERROR org.openbravo.service.json.DefaultJsonDataService - org.openbravo.model.common.plm.Product cannot be cast to java.lang.String
java.lang.ClassCastException: org.openbravo.model.common.plm.Product cannot be cast to java.lang.String
    at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:121)
    at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:77)
    at org.openbravo.base.structure.BaseOBObject.getIdentifier(BaseOBObject.java:195)
    at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:124)
    at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:77)
    at org.openbravo.base.structure.BaseOBObject.getIdentifier(BaseOBObject.java:195)

Following query returns (some of) the columns, around 70, that might be affected by this issue:
select tablename, columnname
  from ad_table t1, ad_column c1
 where t1.ad_table_id = c1.ad_table_id
  and c1.iskey = 'N'
  and c1.isparent ='N'
 and
exists (
select 1
  from ad_table reft
  where c1.columnname ilike reft.tablename||'_id'
    and exists (select 1
                  from ad_column c
                  where c.ad_table_id = reft.ad_table_id
                  and c.isidentifier = 'Y'
                  and exists (select 1
                                 from ad_table trl
                                where tablename ilike substr(c.columnname,1,length(c.columnname)-3)||'_trl')))
  and exists (select 1
            from ad_field f, ad_tab tb
            where f.ad_tab_id = tb.ad_tab_id
            and f.isactive = 'Y' and tb.isactive='Y'
            and f.ad_column_id = c1.ad_column_id)
order by 1,2

-Open, for example, Good Transaction window
-Try to open Good Shipment Line drop down in filter -> Error occurs
The problematic line is in IdentifierProvider

value = ((BaseOBObject) dob).get(identifier.getName(), language, (String) dob.get("id"));

In the situation described, dob.get("id") is a BaseOBObject instead of a String.
No tags attached.
related to defect 00228363.0MP21 closed shankarb In grid view, unit of measure filter is not translated when the translation pack is installed 
related to design defect 0023706 new Triage Platform Base Invalid BaseOBObject in drop down filter lists 
png Selection_163.png (17,914) 2013-05-01 11:19
https://issues.openbravo.com/file_download.php?file_id=6123&type=bug
png
Issue History
2013-05-01 11:13alostaleNew Issue
2013-05-01 11:13alostaleAssigned To => alostale
2013-05-01 11:13alostaleModules => Core
2013-05-01 11:13alostaleTriggers an Emergency Pack => No
2013-05-01 11:17alostaleRegression level => Production - QA Approved
2013-05-01 11:17alostaleRegression date => 2013-03-04
2013-05-01 11:17alostaleRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/f9728bac00aa8157efca54574bed21f0104d8e07 [^]
2013-05-01 11:17alostaleTriggers an Emergency PackNo => Yes
2013-05-01 11:17alostaleRelationship addedrelated to 0022836
2013-05-01 11:18alostaleNote Added: 0058393
2013-05-01 11:18alostaleNote Edited: 0058393bug_revision_view_page.php?bugnote_id=0058393#r4651
2013-05-01 11:19alostaleFile Added: Selection_163.png
2013-05-01 11:21alostaleProposed Solution updated
2013-05-01 12:42alostaleRelationship addedrelated to 0023706
2013-05-01 12:50alostaleNote Added: 0058394
2013-05-01 12:54hgbotCheckin
2013-05-01 12:54hgbotNote Added: 0058396
2013-05-01 12:54hgbotStatusnew => resolved
2013-05-01 12:54hgbotResolutionopen => fixed
2013-05-01 12:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/13bebe76e732bde05939d6003363eebe02b1f881 [^]
2013-05-01 12:54hgbotCheckin
2013-05-01 12:54hgbotNote Added: 0058398
2013-05-01 12:56alostaleReview Assigned To => shankarb
2013-05-01 13:02alostaleNote Added: 0058399
2013-05-02 19:03hudsonbotCheckin
2013-05-02 19:03hudsonbotNote Added: 0058441
2013-05-02 19:03hudsonbotCheckin
2013-05-02 19:03hudsonbotNote Added: 0058444
2013-05-07 15:41shankarbNote Added: 0058487
2013-05-07 15:41shankarbStatusresolved => closed
2013-05-07 15:41shankarbFixed in Version => 3.0MP24
2013-05-07 15:42shankarbNote Added: 0058488
2013-05-07 15:42shankarbStatusclosed => new
2013-05-07 15:42shankarbResolutionfixed => open
2013-05-07 15:42shankarbFixed in Version3.0MP24 =>
2013-05-07 15:42shankarbStatusnew => scheduled
2013-05-07 15:42shankarbfix_in_branch => pi
2013-05-07 15:43shankarbStatusscheduled => resolved
2013-05-07 15:43shankarbResolutionopen => fixed
2013-05-07 15:43shankarbNote Added: 0058489
2013-05-07 15:43shankarbStatusresolved => closed
2013-05-07 15:43shankarbFixed in Version => 3.0MP23

Notes
(0058393)
alostale   
2013-05-01 11:18   
Regression affecting to 3.0MP21, 3.0MP21.1 and 3.0MP22

(0058394)
alostale   
2013-05-01 12:50   
Root cause of this issue is due to incorrect BaseOBObjects created for drop down list in filters (see 0023706).

Current fix is temporary till 0023706 is solved. It is done in this way instead of directly fixing root cause, because current fix is less intrusive in a core piece of code.
(0058396)
hgbot   
2013-05-01 12:54   
Repository: erp/devel/pi
Changeset: 13bebe76e732bde05939d6003363eebe02b1f881
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed May 01 12:51:36 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/13bebe76e732bde05939d6003363eebe02b1f881 [^]

fixed bug 23705: Not possible to select a value in drop down filter

This is a temporary fix that should be reviewed again when issue 23706 is fixed

---
M src/org/openbravo/base/structure/IdentifierProvider.java
---
(0058398)
hgbot   
2013-05-01 12:54   
Repository: erp/devel/pi
Changeset: eb2fcc35a94752232263dfef6b6133aafca9c003
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed May 01 12:53:04 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/eb2fcc35a94752232263dfef6b6133aafca9c003 [^]

related to bug 23706, related to bug 23705

Added comment not to forget to review change for issue 23705 when 23706 is solved

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
---
(0058399)
alostale   
2013-05-01 13:02   
Provided fix is not risky. In manages the corner case of invalid BaseOBObject when dealing with translatable identifiers. Trying to get a valid id, which was failing, and falling back to behavior previous to 0022836 in case it is not possible.

Tested the regression doesn't appear anymore and that issue 0022836 cannot be reproduced after the fix.
(0058441)
hudsonbot   
2013-05-02 19:03   
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/b67b46460127 [^]

Maturity status: Test
(0058444)
hudsonbot   
2013-05-02 19:03   
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/b67b46460127 [^]

Maturity status: Test
(0058487)
shankarb   
2013-05-07 15:41   
Code reviewed and tested in pi changeset d17e521df335.
(0058488)
shankarb   
2013-05-07 15:42   
Reopened to update Fixed in version
(0058489)
shankarb   
2013-05-07 15:43   
Code reviewed and tested in pi changeset d17e521df335