Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0029248 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | minor | always | 2015-03-12 09:56 | 2015-03-13 11:16 | |||
Reporter | caristu | View Status | public | |||||
Assigned To | AugustoMauch | |||||||
Priority | immediate | Resolution | fixed | Fixed in Version | 3.0PR15Q2 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 59a302602f2f | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | pi | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | alostale | |||||||
OBNetwork customer | OBPS | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | 34969 | |||||||
Regression level | Production - Confirmed Stable | |||||||
Regression date | 2014-05-20 | |||||||
Regression introduced in release | 3.0PR14Q3 | |||||||
Regression introduced by commit | https://code.openbravo.com/erp/devel/pi/rev/d9ce373c75dad51598fb943d75e4d8e56f1d56eb [^] | |||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0029248: Can't filter in numeric fields using the value 0 | |||||||
Description | Is not possible to filter numeric fields using the value 0, the following error appears in the javascript console: "Uncaught TypeError: Cannot read property 'operator' of undefined" | |||||||
Steps To Reproduce | 1) Go to the Sales Order window 2) Try to filter by Delivery Status or Invoice Status fields , using the value 0 3) Notice that the filtering is not done and the error in description appears | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||||||||||||||||
|
![]() |
|
(0075481) hgbot (developer) 2015-03-12 12:56 |
Repository: erp/devel/pi Changeset: 59a302602f2f7757baf69cbdb1862014393bd9f7 Author: Augusto Mauch <augusto.mauch <at> openbravo.com> Date: Thu Mar 12 12:00:30 2015 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/59a302602f2f7757baf69cbdb1862014393bd9f7 [^] Fixes issue 29248: 0 can be used to filter numeric columns In this changeset [1] this code was added to the OBNumberItem.parseValueExpressions function: ret = this.Super('parseValueExpressions', [value, fieldName, operator]); + + // if operator is not supported remove it + if (!this.validOperators.contains(ret.operator)) { + ret.operator = ''; + ret.value = ''; + this.setValue(''); + } if (ret && ret.start) { ret.start = this.convertToTypedValue(ret.start); } The problem is that if the provided value is 0, this.Super('parseValueExpressions', [value, fieldName, operator]) will return undefined. This happens because of a bug in smartclient's implementation of the parseValueExpressions function. This code is placed at the beginning of that function: if (!value) value = this.getValue(); if (!value) return; if (!isc.isA.String(value)) value += ""; If the provided value is 0, the value will be taken from this.getValue(). The returned value will again be evaluated to false, so the function will not return any value. Right after that, there is a comman d to convert the provided value to String. To fix this, in the call to this.Super('parseValueExpressions'), the string representation of the number will be passed instead of its numerical value. This way smartclient will accept the value and will n ot return undefined. Smartclient was already converting the passed values to String, so there is no risk there. The value passed to the OBNumberItem.parseValueExpressions is not modified to prevent unexpected consequences. A copy of it is converted to string and passed to the this.Super('parseValueExpressions') func tion. [1] https://code.openbravo.com/erp/devel/pi/rev/d9ce373c75dad51598fb943d75e4d8e56f1d56eb [^] --- M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js --- |
(0075513) hudsonbot (viewer) 2015-03-13 03:18 |
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/6f599d5217c4 [^] Maturity status: Test |
(0075518) AugustoMauch (administrator) 2015-03-13 09:26 |
Test created in testlink: http://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-8136 [^] |
(0075529) alostale (viewer) 2015-03-13 11:16 |
code reviewed tested in Sales Order delivery status (computed column) and total gross amount (regular column) with values: -0 -100 ->1000 -<1000 -^3 (as reported in 0026305, in this case the filter is removed as it is not supported textual filters in numeric columns) |
![]() |
|||
Date Modified | Username | Field | Change |
2015-03-12 09:56 | caristu | New Issue | |
2015-03-12 09:56 | caristu | Assigned To | => AugustoMauch |
2015-03-12 09:56 | caristu | OBNetwork customer | => Yes |
2015-03-12 09:56 | caristu | Modules | => Core |
2015-03-12 09:56 | caristu | Support ticket | => 34969 |
2015-03-12 09:56 | caristu | Triggers an Emergency Pack | => No |
2015-03-12 09:56 | caristu | Issue Monitored: networkb | |
2015-03-12 09:57 | caristu | Regression introduced in release | => 3.0PR14Q4 |
2015-03-12 09:57 | caristu | version | => pi |
2015-03-12 11:07 | AugustoMauch | Regression level | => Production - Confirmed Stable |
2015-03-12 11:07 | AugustoMauch | Regression date | => 2014-05-20 |
2015-03-12 11:07 | AugustoMauch | Regression introduced in release | 3.0PR14Q4 => 3.0PR14Q3 |
2015-03-12 11:07 | AugustoMauch | Regression introduced by commit | => https://code.openbravo.com/erp/devel/pi/rev/d9ce373c75dad51598fb943d75e4d8e56f1d56eb [^] |
2015-03-12 11:18 | AugustoMauch | Summary | Can't filter in some fields using the value 0 => Can't filter in numeric fields using the value 0 |
2015-03-12 11:18 | AugustoMauch | Description Updated | View Revisions |
2015-03-12 11:18 | AugustoMauch | Steps to Reproduce Updated | View Revisions |
2015-03-12 11:33 | AugustoMauch | Status | new => scheduled |
2015-03-12 11:49 | AugustoMauch | Relationship added | caused by 0026305 |
2015-03-12 12:56 | hgbot | Checkin | |
2015-03-12 12:56 | hgbot | Note Added: 0075481 | |
2015-03-12 12:56 | hgbot | Status | scheduled => resolved |
2015-03-12 12:56 | hgbot | Resolution | open => fixed |
2015-03-12 12:56 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/59a302602f2f7757baf69cbdb1862014393bd9f7 [^] |
2015-03-13 03:18 | hudsonbot | Checkin | |
2015-03-13 03:18 | hudsonbot | Note Added: 0075513 | |
2015-03-13 09:26 | AugustoMauch | Note Added: 0075518 | |
2015-03-13 11:16 | alostale | Review Assigned To | => alostale |
2015-03-13 11:16 | alostale | Note Added: 0075529 | |
2015-03-13 11:16 | alostale | Status | resolved => closed |
2015-03-13 11:16 | alostale | Fixed in Version | => 3.0PR15Q2 |
Copyright © 2000 - 2009 MantisBT Group |