Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029010Openbravo ERPA. Platformpublic2015-02-20 10:072015-04-01 08:47
VictorVillar 
AugustoMauch 
immediateminoralways
closedfixed 
5
3.0PR14Q3.6 
3.0PR15Q2 
alostale
Core
Production - Confirmed Stable
2014-09-25
3.0PR14Q3.5
https://code.openbravo.com/erp/devel/pi/rev/653cc69090124def179091b96d9d2d820cc47d2b [^]
No
0029010: the grid is filtering by relative date not the absolute
The grid is filtering by relative date not the absolute.
Imagine that today is: 20/02/2015
As group admin role,
 Go to Sales Order window.
   Create one register for 20/02/2015
Save it.
Create a new one for 21/02/2015
Save it.

Filter the order date by the absolute day. Select 'Since date': TODAY from the dropdown, not the calendar - 'to date': blank
Save the view and set it as default.

The next day (in the current example 21/02/2015)
As group admin role,
 Go to Sales Order window.
Realise that you can see the register with order date: 20/02/2015 and it is wrong, because the filter should filter by TODAY.

No tags attached.
caused by defect 0027679 closed shankarb can't use FK drop down if grid is already filtered by a relative date 
Issue History
2015-02-20 10:07VictorVillarNew Issue
2015-02-20 10:07VictorVillarAssigned To => AugustoMauch
2015-02-20 10:07VictorVillarModules => Core
2015-02-20 10:07VictorVillarResolution time => 1426546800
2015-02-20 10:07VictorVillarRegression level => Production - Confirmed Stable
2015-02-20 10:07VictorVillarRegression introduced in release => 3.0PR14Q3.5
2015-02-20 10:07VictorVillarTriggers an Emergency Pack => No
2015-02-20 10:08VictorVillarIssue Monitored: networkb
2015-02-20 11:15eugeniIssue Monitored: eugeni
2015-02-20 14:27AugustoMauchStatusnew => scheduled
2015-02-20 14:27AugustoMauchfix_in_branch => pi
2015-02-24 10:08alostaleSeveritymajor => minor
2015-02-24 10:08alostalefix_in_branchpi =>
2015-02-24 11:58AugustoMauchNote Added: 0074842
2015-02-24 11:58AugustoMauchStatusscheduled => feedback
2015-02-24 12:14AugustoMauchNote Added: 0074843
2015-02-24 12:17alostaleAssigned ToAugustoMauch => VictorVillar
2015-02-24 18:21AugustoMauchStatusfeedback => scheduled
2015-02-24 18:21AugustoMauchNote Added: 0074877
2015-02-24 18:21AugustoMauchfix_in_branch => pi
2015-02-24 18:49VictorVillarfix_in_branchpi =>
2015-02-24 18:49VictorVillarSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7754#r7754
2015-02-24 18:54AugustoMauchRegression date => 2014-09-25
2015-02-24 18:54AugustoMauchRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/653cc69090124def179091b96d9d2d820cc47d2b [^]
2015-02-24 22:18AugustoMauchIssue Monitored: alostale
2015-02-24 22:18AugustoMauchAssigned ToVictorVillar => AugustoMauch
2015-02-24 22:18AugustoMauchReview Assigned To => alostale
2015-02-24 22:19hgbotCheckin
2015-02-24 22:19hgbotNote Added: 0074888
2015-02-24 22:19hgbotStatusscheduled => resolved
2015-02-24 22:19hgbotResolutionopen => fixed
2015-02-24 22:19hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9645a99f13363ff71be9a0f1724f4be5853ad95a [^]
2015-02-25 08:38alostaleRelationship addedcaused by 0027679
2015-02-25 09:45AugustoMauchNote Added: 0074898
2015-02-25 21:22hudsonbotCheckin
2015-02-25 21:22hudsonbotNote Added: 0074945
2015-03-02 09:01alostaleNote Added: 0075054
2015-03-02 09:01alostaleStatusresolved => closed
2015-03-02 09:01alostaleFixed in Version => 3.0PR15Q2
2015-04-01 08:05hgbotCheckin
2015-04-01 08:05hgbotNote Added: 0076192
2015-04-01 08:05hgbotStatusclosed => resolved
2015-04-01 08:05hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/9645a99f13363ff71be9a0f1724f4be5853ad95a [^] => http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/fce7cf4dee157ad80f6be87fa8b02a392b88aed8 [^]
2015-04-01 08:47priyamStatusresolved => closed
2015-04-01 08:47priyamNote Added: 0076283

Notes
(0074842)
AugustoMauch   
2015-02-24 11:58   
Hi,

I have not been able to reproduce the proper behaviour in 3.0PR14Q3.4. The filtered day was the same even the day after setting it using the Today button.
(0074843)
AugustoMauch   
2015-02-24 12:14   
This is the smartclient code that is invoked when the Today button is invoked:

  todayClick : function () {
    var date = new Date();
    this.dateClick(date.getFullYear(), date.getMonth(), date.getDate(), true);
  },

It invokes the dateClick method with today's date, which is the same method that is invoked when a non-relative date is selected. The criteria built based on clicking the Today button will be the same that the criteria built after selecting manually todays date (by selected the proper year, month and day number).

This being considered, it is highly unlikely that at any point clicking on the Today button would generate a criteria that would change each passing day.
(0074877)
AugustoMauch   
2015-02-24 18:21   
The date filter is working as expected on a PR14Q3.3 instance, so the issue is actually a regression
(0074888)
hgbot   
2015-02-24 22:19   
Repository: erp/devel/pi
Changeset: 9645a99f13363ff71be9a0f1724f4be5853ad95a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 24 22:16:04 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9645a99f13363ff71be9a0f1724f4be5853ad95a [^]

Fixes issue 29010: Grid is actually filtered using relative dates

The problem was that when a relative date filter was added to the grid and then used in a saved view, the saved view will not apply the relative date filter, but an absolute one. This was caused by this code in the OBViewGrid.convertCriteria function:

    if (this.dataSource) {
      criteria = this.dataSource.convertRelativeDates(criteria);
    }

Every time that a criteria is sent to the backend (i.e. when storing a saved view), the criteria objects that contained relative dates wwere converted to absolute dates. This was done to fix this issue
 [1], its problem being that the datasource used to populate the filter drop down did not support relative dates.

The function where that code was placed was too central, the criterias converted should have been only the ones used to populate the filter drop downs, but all the criterias were being converted. To fix this, the code has been adapted and moved to the OBFKFilterTextItem.getPickListFilterCriteria function.
[1] https://issues.openbravo.com/view.php?id=27679 [^]

---
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-view-grid.js
---
(0074898)
AugustoMauch   
2015-02-25 09:45   
A testlink test case has been created [1]. In order to automate this test, it should be possible to created Saved Views using selenium.

[1] http://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-8050 [^]
(0074945)
hudsonbot   
2015-02-25 21: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/96ba7b028cb7 [^]
Maturity status: Test
(0075054)
alostale   
2015-03-02 09:01   
Code reviewed.

Tested:
-Test case defined in test link
-Issue 0027679 is still not reproducible
-Direct with relative dates link works:
  * From URL
  * From quick launch
(0076192)
hgbot   
2015-04-01 08:05   
Repository: erp/backports/3.0PR15Q2
Changeset: fce7cf4dee157ad80f6be87fa8b02a392b88aed8
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 24 22:16:04 2015 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/fce7cf4dee157ad80f6be87fa8b02a392b88aed8 [^]

Fixes issue 29010: Grid is actually filtered using relative dates

The problem was that when a relative date filter was added to the grid and then used in a saved view, the saved view will not apply the relative date filter, but an absolute one. This was caused by this code in the OBViewGrid.convertCriteria function:

    if (this.dataSource) {
      criteria = this.dataSource.convertRelativeDates(criteria);
    }

Every time that a criteria is sent to the backend (i.e. when storing a saved view), the criteria objects that contained relative dates wwere converted to absolute dates. This was done to fix this issue
 [1], its problem being that the datasource used to populate the filter drop down did not support relative dates.

The function where that code was placed was too central, the criterias converted should have been only the ones used to populate the filter drop downs, but all the criterias were being converted. To fix this, the code has been adapted and moved to the OBFKFilterTextItem.getPickListFilterCriteria function.
[1] https://issues.openbravo.com/view.php?id=27679 [^]

---
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-view-grid.js
---
(0076283)
priyam   
2015-04-01 08:47   
closed again, as the status changes due to merge of tag 15Q1.2 to backport repo Q2