Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027769Openbravo ERPA. Platformpublic2014-10-06 11:532014-12-30 23:22
mtaal 
AugustoMauch 
immediateminorhave not tried
closedfixed 
5
main 
3.0PR14Q4 
alostale
Core
Packaging and release
2014-07-14
main
http://code.openbravo.com/erp/devel/pi/rev/fab9b7248bbb2a08d1486d2481f4478722a83186 [^]
No
0027769: Record id shown in grid filtering, when adding a new column to the grid
When filtering on a Foreign Key and then adding a column to the grid, the result is that the FK filter changes and shows the ID of the record.

See here:
http://screencast.com/t/p2Axbnt6TW [^]

Note the jing movie shows the case that there are multiple records with the same identifier, but the issue can also be reproduced by filtering on a record with a unique identifier.
.
No tags attached.
caused by design defect 0025211 closed AugustoMauch Filter by selected value in FK uses identifier instead of ID 
related to defect 00302743.0PR15Q4 closed caristu In saved views with multiple criteria in one field, the uuid value is shown in the column header when filtering sometimes 
Issue History
2014-10-06 11:53mtaalNew Issue
2014-10-06 11:53mtaalAssigned To => AugustoMauch
2014-10-06 11:53mtaalModules => Core
2014-10-06 11:53mtaalTriggers an Emergency Pack => No
2014-10-06 11:55mtaalTarget Version3.0PR14Q4 =>
2014-10-06 16:27jonalegriaesarteResolution time => 1415142000
2014-10-07 08:40alostaleRegression level => Packaging and release
2014-10-07 08:40alostaleRegression date => 2014-07-14
2014-10-07 08:40alostaleRegression introduced in release => main
2014-10-07 08:40alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/fab9b7248bbb2a08d1486d2481f4478722a83186 [^] http://code.openbravo.com/erp/devel/pi/rev/fab9b7248bbb2a08d1486d2481f4478722a83186 [^]
2014-10-07 08:40alostalePrioritynormal => immediate
2014-10-07 08:40alostaleSeveritymajor => minor
2014-10-07 08:40alostaleRegression introduced by commithttp://code.openbravo.com/erp/devel/pi/rev/fab9b7248bbb2a08d1486d2481f4478722a83186 [^] http://code.openbravo.com/erp/devel/pi/rev/fab9b7248bbb2a08d1486d2481f4478722a83186 [^] => http://code.openbravo.com/erp/devel/pi/rev/fab9b7248bbb2a08d1486d2481f4478722a83186 [^]
2014-10-07 08:40alostaleRelationship addedcaused by 0025211
2014-10-07 08:52alostaleNote Added: 0070759
2014-10-07 08:53alostaleversion3.0PR14Q2.5 => main
2014-10-07 13:16AugustoMauchIssue Monitored: alostale
2014-10-07 13:16AugustoMauchReview Assigned To => alostale
2014-10-07 13:18hgbotCheckin
2014-10-07 13:18hgbotNote Added: 0070766
2014-10-07 13:18hgbotStatusnew => resolved
2014-10-07 13:18hgbotResolutionopen => fixed
2014-10-07 13:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c8400accd26c4125ebe15dfdfcc26705afa9bf74 [^]
2014-10-07 14:34alostaleNote Added: 0070774
2014-10-07 14:34alostaleStatusresolved => new
2014-10-07 14:34alostaleResolutionfixed => open
2014-10-07 16:05hgbotCheckin
2014-10-07 16:05hgbotNote Added: 0070775
2014-10-07 16:05hgbotStatusnew => resolved
2014-10-07 16:05hgbotResolutionopen => fixed
2014-10-07 16:05hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/c8400accd26c4125ebe15dfdfcc26705afa9bf74 [^] => http://code.openbravo.com/erp/devel/pi/rev/7198f6b050d38d2e02db062f9f192e80344bf29e [^]
2014-10-08 08:35alostaleNote Added: 0070792
2014-10-08 08:35alostaleStatusresolved => closed
2014-10-08 08:35alostaleFixed in Version => 3.0PR14Q4
2014-12-30 23:22hudsonbotCheckin
2014-12-30 23:22hudsonbotNote Added: 0072909
2014-12-30 23:22hudsonbotCheckin
2014-12-30 23:22hudsonbotNote Added: 0072912
2015-06-29 13:08egoitzRelationship addedrelated to 0030274

Notes
(0070759)
alostale   
2014-10-07 08:52   
This can be reproduced also when hiding a column from grid.
(0070766)
hgbot   
2014-10-07 13:18   
Repository: erp/devel/pi
Changeset: c8400accd26c4125ebe15dfdfcc26705afa9bf74
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Oct 07 13:16:06 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c8400accd26c4125ebe15dfdfcc26705afa9bf74 [^]

Fixes issue 27769: Record id not shown in the filter when a new field is added

When a foreign key field is being filtered using its id (i.e. by selecting a record from its drop down), its filterType property is set to 'id'. This property is then used in several places like in the getCriterion and getCriterion. The problem was that when adding/removing a field from the grid, the filter fields are rebuilt from scratch and the filterType property was being reset to its default value ('identifier'). To fix this, the list of foreign key fields being filtered by their id is stored before resetting the filter fields, and consulted when initializing the foreign key fields.

Also the foreign key cache needs to be persisted in order to be able to obtain the record's identifier given its id (in the criteria only the id is stored).

The getFKFilterAuxiliaryCache function has been moved from OBViewGrid to OBGrid so that it can also be used in Pick&Execute grids. This has no risk, as it did not use any code specific from OBViewGrid.

---
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.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0070774)
alostale   
2014-10-07 14:34   
Reopening, failed test cases 5 and 6 (see below)

Test cases:

All of them executed in sales order window, in all the cases check BP is filtered correctly and "==Alimentos y Supermercados" appears in the filter text box.

1. Add new grid column --> OK
  1.1 Clear filters
  1.2 Filter BP by Alimentos y Supermercados
  1.3 Add Warehouse column

2. Remove grid column --> OK
  2.1 Clear filters
  2.2 Filter BP by Alimentos y Supermercados
  2.3 Remove Warehouse column

3. Saved view --> OK
  3.1 Save view
  3.2 Close Sales Order window
  3.3 Reopen Sales Order window
  3.4 Applied saved view
  
4. Saved default view --> OK
  4.1 Select saved view as default
  4.2 Close Sales Order window
  4.3 Reopen Sales Order window
  
5. Direct link from Quick Launch --> FAIL (was working in live)
  5.1 Get direct link having the filter applied
  5.2 Copy direct link in Quick Launch
       --> filter is correctly applied but ID is seen in filter text box

6. Direct link from URL --> FAIL (was working in live)
  6.1 Get direct link having the filter applied
  6.2 Copy direct link in URL
       --> filter is correctly applied but ID is seen in filter text box
(0070775)
hgbot   
2014-10-07 16:05   
Repository: erp/devel/pi
Changeset: 7198f6b050d38d2e02db062f9f192e80344bf29e
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Oct 07 16:04:45 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7198f6b050d38d2e02db062f9f192e80344bf29e [^]

Fixes issue 27769: Record id not shown when opening link from URL

In the OBGrid.setFields function, the originally named fkCache was meant to store the information needed to restore the state of the foreign key columns after resetting the fields. The scope of that auxiliary cache was setField function, that is why it is deleted from the object before leaving the function.

The problem was that 'fkCache' was already being used to name another property. This property stores the id-identifier pairings of the criterias saved in direct links. As that property was being removed when the grid fields were set, if a tab was opened using a direct link the criterias on the foreign key columns showed their ids.

This problem has been fixed by renaming the temporal property used in the setFields function.

---
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
---
(0070792)
alostale   
2014-10-08 08:35   
Code reviewed

Tested with the cases described in note above.

Added those test cases to test link: http://tools.openbravo.com:8891/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-7869 [^]
(0072909)
hudsonbot   
2014-12-30 23:22   
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/6525fe229e06 [^]
Maturity status: Test
(0072912)
hudsonbot   
2014-12-30 23:22   
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/6525fe229e06 [^]
Maturity status: Test