Project:
| View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | ||||||||
| 0037390 | ||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
| defect | [Openbravo ERP] 00. Application dictionary | minor | always | 2017-11-27 12:33 | 2018-01-03 12:39 | |||
| Reporter | gorkaion | View Status | public | |||||
| Assigned To | alostale | |||||||
| Priority | high | Resolution | fixed | Fixed in Version | 3.0PR18Q1 | |||
| Status | closed | Fix in branch | Fixed in SCM revision | 6a9db69516b2 | ||||
| Projection | none | ETA | none | Target Version | ||||
| OS | Any | Database | Any | Java version | ||||
| OS Version | Database version | Ant version | ||||||
| Product Version | SCM revision | |||||||
| Merge Request Status | ||||||||
| Review Assigned To | caristu | |||||||
| OBNetwork customer | No | |||||||
| Web browser | ||||||||
| Modules | Core | |||||||
| Support ticket | 49647 | |||||||
| Regression level | ||||||||
| Regression date | ||||||||
| Regression introduced in release | ||||||||
| Regression introduced by commit | ||||||||
| Triggers an Emergency Pack | No | |||||||
| Summary | 0037390: < and > operators fail when comparing negative values in Display Logic | |||||||
| Description | "<" and ">" are not properly managed by DynamicExpressionParser and produces a wrong javascript code when comparing with negative values. When creating a Display Logic like: @grandTotalAmount@ < - 5 It is translated to: OB.Utilities.getValue(currentValues,'grandTotalAmount') < !== 5 This is caused because the "<" is not considered as a comparator and the "-" sign is considered instead. In this case it replaces the "-" with "!==" which results in a wrong js code. | |||||||
| Steps To Reproduce | On Sales Invoice window. Create some invoices with negative and positive total amounts. On the Application Dictionary modify the Display Logic of the "APRM Process Invoice" field to "@GrandTotal@ > - 5". So it only shows the "Complete" button if the total amount of the invoice is higher than "-5". Try to open the Sales Invoice tab and it fails. If you check the browser's console you see a javascript error with the wrong displayIf function. | |||||||
| Proposed Solution | Add the "<", ">", "<=" and ">=" to the array of "COMPARATIONS" in DynamicExpressionParser. So the negative number is considered as the right part of the expression and the "-" sign is not replaced by "!==". | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Relationships [ Relation Graph ]
[ Dependency Graph ]
|
|
Notes |
|
|
(0100754) hgbot (developer) 2017-11-28 09:57 |
Repository: erp/devel/pi Changeset: 6a9db69516b2560f153d3390235b88d447af4d7e Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Tue Nov 28 09:48:01 2017 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/6a9db69516b2560f153d3390235b88d447af4d7e [^] fixed bug 37390: can't compare gt or lt with negative values in display logic When comparing negative values with gt (>), lt (>), ge (>=) or le (>=) the generated JavaScript expression was incorrect. Those operators were not properly parsed because they were not declared in DynamicExpressionParser. --- M modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/DynamicExpressionParserTest.java M modules/org.openbravo.client.application/src/org/openbravo/client/application/DynamicExpressionParser.java --- |
|
(0100800) caristu (viewer) 2017-11-28 19:34 |
Code reviewed + tested OK. |
|
(0101465) hudsonbot (viewer) 2018-01-03 12:39 |
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/c81e0d3cbab5 [^] Maturity status: Test |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2017-11-27 12:33 | gorkaion | New Issue | |
| 2017-11-27 12:33 | gorkaion | Assigned To | => platform |
| 2017-11-27 12:33 | gorkaion | OBNetwork customer | => No |
| 2017-11-27 12:33 | gorkaion | Modules | => Core |
| 2017-11-27 12:33 | gorkaion | Support ticket | => 49647 |
| 2017-11-27 12:33 | gorkaion | Triggers an Emergency Pack | => No |
| 2017-11-28 09:35 | alostale | Status | new => scheduled |
| 2017-11-28 09:35 | alostale | Assigned To | platform => alostale |
| 2017-11-28 09:57 | hgbot | Checkin | |
| 2017-11-28 09:57 | hgbot | Note Added: 0100754 | |
| 2017-11-28 09:57 | hgbot | Status | scheduled => resolved |
| 2017-11-28 09:57 | hgbot | Resolution | open => fixed |
| 2017-11-28 09:57 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/6a9db69516b2560f153d3390235b88d447af4d7e [^] |
| 2017-11-28 09:57 | alostale | Review Assigned To | => caristu |
| 2017-11-28 19:34 | caristu | Note Added: 0100800 | |
| 2017-11-28 19:34 | caristu | Status | resolved => closed |
| 2017-11-28 19:34 | caristu | Fixed in Version | => 3.0PR18Q1 |
| 2018-01-03 12:39 | hudsonbot | Checkin | |
| 2018-01-03 12:39 | hudsonbot | Note Added: 0101465 | |
| Copyright © 2000 - 2009 MantisBT Group |