details:   https://code.openbravo.com/erp/devel/pi/rev/2bc577948e7d
changeset: 35848:2bc577948e7d
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Mon May 20 16:11:56 2019 +0200
summary:   fixes bug 40802: "Use as filter" is not working properly with 
DateTime columns

  After this changeset[1] it was fixed the ability to filter properly by a 
range of DateTime values. However, this change broke the correct filtering by a 
single DateTime value in this type of columns.

  But when filtering a DateTime column with a single DateTime value (when not 
filtering by a range of dates), in general, the idea is to use the plain date 
value and build the criteria properly in the backend(See[2]).

  Therefore now we are adapting the way that the criteria is build using the 
"Use as Filter" menu option to generate the criteria in the same way as when 
the filter is entered manually in a DateTime column. And this is done by 
building the criteria to filter the DateTime column using a plain date.


[1] 
https://code.openbravo.com/erp/devel/pi/rev/90ee5c965823996a7b4c0ae17d3a3ca71e3fc703
[2] https://issues.openbravo.com/view.php?id=23203

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
 |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 9ee5dc3a2747 -r 2bc577948e7d 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Mon May 20 12:53:35 2019 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Mon May 20 16:11:56 2019 +0200
@@ -2563,6 +2563,8 @@
           }
           // assume a date range filter item
           if (isc.isA.Date(value) && field.filterEditorType === 
'OBMiniDateRangeItem') {
+            // set the logicalDate property to true so that the date values 
contained in the filter criteria will always be serialized as plain dates
+            value.logicalDate = true;
             filterFormItem.setSingleDateValue(value);
           } else {
             grid.filterEditor.getEditForm().setValue(field.name, 
OB.Utilities.encodeSearchOperator(value));


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to