Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007375Openbravo ERPZ. Otherspublic2009-02-05 09:322011-09-21 22:59
artem 
shuehner 
normalminoralways
closedout of date 
5
pi 
 
Core
No
0007375: Aceptar function in Buscador.java has redundant conditions.
Aceptar function in Buscador.java has redundant conditions if checkboxes controls are involved into comparison.
For ex. clicking the Master Data Management || Business Partner || Business Partner initiates popup with four fields, three of them are checkboxes.
Function aceptar below in part of condition:

if ((frm.inpParamName.value==null || frm.inpParamName.value=="") && (frm.inpParamIsCustomer.value==null || frm.inpParamIsCustomer.value=="") && (frm.inpParamIsVendor.value==null || frm.inpParamIsVendor.value=="") && (frm.inpParamIsActive.value==null || frm.inpParamIsActive.value=="") ) {
    showJSMessage(1);
    return false;
  }

Value property of checkbox is always set as 'Y' value and it not makes sense to do this check for them at all.
Remove checkboxes from the check for mandatory fields.
No tags attached.
blocks feature request 0007236 acknowledged shuehner Tracking issue: Cleanup for 3.00 
Issue History
2009-02-05 09:32artemNew Issue
2009-02-05 09:32artemAssigned To => rafaroda
2009-02-05 09:32artemsf_bug_id0 => 2567401
2009-02-05 09:32artemRegression testing => No
2009-02-05 09:33artemDescription Updated
2009-02-10 10:58rafarodaNote Added: 0013292
2009-02-10 10:58rafarodaAssigned Torafaroda => shuehner
2009-02-13 16:53shuehnerNote Added: 0013482
2009-02-13 16:53shuehnerStatusnew => feedback
2009-02-16 15:39artemNote Added: 0013535
2009-02-16 15:39artemStatusfeedback => new
2009-02-16 15:39artemTypedefect => feature request
2009-02-16 15:39artemSummaryFunction 'aceptar' performs incorrect comparison => Aceptar function in Buscador.java has redundant conditions.
2009-02-16 15:39artemDescription Updated
2009-02-16 15:39artemSteps to Reproduce Updated
2009-02-17 12:38shuehnerRelationship addedblocks 0007236
2009-02-17 12:38shuehnerStatusnew => acknowledged
2011-09-21 22:57shuehnerStatusacknowledged => scheduled
2011-09-21 22:59shuehnerNote Added: 0041217
2011-09-21 22:59shuehnerStatusscheduled => closed
2011-09-21 22:59shuehnerResolutionopen => out of date

Notes
(0013292)
rafaroda   
2009-02-10 10:58   
Stefan, from an HTML perspective this seems clearly a bad coding. But could you please confirm that when the filtering is done in Search pop-up it works properly with this tricky code (in which case this would not be a defect)?

Thank you.
(0013482)
shuehner   
2009-02-13 16:53   
Hello Artem,

this if-condition checks if all mandatory fields are filled in and shows an error message otherwise. For html-checkboxes it does not make sense to include them in general as they always have a value (either checked or unchecked) but cannot be "empty".

Idea is to retitle your issue to feature request, remove checkboxes from the check for mandatory fields as it not makes sense to do this check for them at all.

Could you tell me if you see/get any wrong user visible behavior out of this or agree to just remove the part in question to clean up the coding?
(0013535)
artem   
2009-02-16 15:39   
Hello shuehner,

Your notes are reasonable and I've updated the issue according to them.

Thank you.
(0041217)
shuehner   
2011-09-21 22:59   
Hi Artem,

in the new 3.0 major version the filter have been re-designed completely (no special filter popup anymore) but instead the filters are integrated as a line above the grid area. The new implementation does not have this redundant conditions anymore.

The old code is still present but no longer used by default and kind of deprecated and will be removed completely over time.

So marking the issue as out-of-date as its no longer very useful to clean-up the code which is planned to be just removed completely.