Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021533Openbravo ERPA. Platformpublic2012-09-03 13:082012-09-26 17:18
mtaal 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
3.0MP16 
mtaal
Core
No
0021533: ShowIf computation incorrect for showIf values which are a boolean
In the ob-main-view.js the showIf property is replaced with a function, see this line:
 fld.showIf = function (item, value, form, values) {

then the original value of showIf is stored in the originalShowIf property. And it is then called in the function above:
          originalShowIfValue = this.originalShowIf(item, value, form, currentValues, context);

But this fails if the original show If value is not a function but a string (for example: "false").

For fields initially not displayed in the grid the showIf has the value "false", see this snippet in the view field ftl:
            <#if !field.showInitiallyInGrid>
                , showIf: '${field.showInitiallyInGrid?string}'
            </#if>
and this is not a function, so treating it as a function call in the ob-view-main.js is wrong. The function definition in ob-view-main.js should be changed to take into account string values.
See for example the net list price in the sales order line tab.
No tags attached.
related to defect 0021530 closed shankarb Grid editing: columns with displaylogic do not work correctly 
Issue History
2012-09-03 13:08mtaalNew Issue
2012-09-03 13:08mtaalAssigned To => marvintm
2012-09-03 13:08mtaalModules => Core
2012-09-03 13:10mtaalRelationship addedrelated to 0021530
2012-09-05 17:22AugustoMauchAssigned Tomarvintm => AugustoMauch
2012-09-07 13:58AugustoMauchClosed by => mtaal
2012-09-07 13:59hgbotCheckin
2012-09-07 13:59hgbotNote Added: 0051932
2012-09-07 13:59hgbotStatusnew => resolved
2012-09-07 13:59hgbotResolutionopen => fixed
2012-09-07 13:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6b2ba000fb7a772d810be7fb7ace8d17a64fff18 [^]
2012-09-07 14:41hgbotCheckin
2012-09-07 14:41hgbotNote Added: 0051942
2012-09-14 11:39mtaalNote Added: 0052123
2012-09-14 11:39mtaalStatusresolved => closed
2012-09-14 11:39mtaalFixed in Version => 3.0MP16
2012-09-26 17:18hudsonbotCheckin
2012-09-26 17:18hudsonbotNote Added: 0052713
2012-09-26 17:18hudsonbotCheckin
2012-09-26 17:18hudsonbotNote Added: 0052717

Notes
(0051932)
hgbot   
2012-09-07 13:59   
Repository: erp/devel/pi
Changeset: 6b2ba000fb7a772d810be7fb7ace8d17a64fff18
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Sep 07 13:57:57 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6b2ba000fb7a772d810be7fb7ace8d17a64fff18 [^]

Fixes issue 21533: Showif computation now supports boolean values

Now, before trying to execute the originalShowIf property, it is checked if it is set to 'true' or 'false'. In that case, it is assigned to originalShowIfValue the corresponding boolean. If not, it is executed as a function as usual.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
---
(0051942)
hgbot   
2012-09-07 14:41   
Repository: erp/devel/pi
Changeset: c60e1cf42d3b190810fdddfe4dfc2c2d2d53def4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Sep 07 14:40:32 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c60e1cf42d3b190810fdddfe4dfc2c2d2d53def4 [^]

Related to issue 21533: Fix refactored to detect if input is a function

The code has been refactored, so that if the input is a function is executes it, while if it is not a function, it tries to decode using isc.JSON.decode.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
---
(0052123)
mtaal   
2012-09-14 11:39   
Reviewed
(0052713)
hudsonbot   
2012-09-26 17: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/b780e90c6452 [^]

Maturity status: Test
(0052717)
hudsonbot   
2012-09-26 17: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/b780e90c6452 [^]

Maturity status: Test