Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031331Openbravo ERPA. Platformpublic2015-11-03 10:292016-03-17 10:54
malsasua 
caristu 
urgentminorsometimes
closedfixed 
20Community Appliance
 
3.0PR16Q23.0PR16Q2 
alostale
Core
No
0031331: When add new lines in sales order, the product field is already filled
when you add several lines in sales order window, the product field is already filled
1-Go to Sales Order window.
2-Create a new record in form and save it.
3-Go to lines tab.
4-Create a new record in form.
5-Select a product from the drop down.
6-Click on the save button and immediately click on the create a new record in a form button.
7-Realize that the product still appears in the product field.


No tags attached.
related to defect 0030940 closed NaroaIriarte When add a second new line in goods movements, the product field is already filled 
related to defect 0031428 acknowledged Triage Platform Base The buttons of the toolbar are not disablen when saving a new record in grid. 
related to defect 0031449 acknowledged Triage Platform Base When clicking the save button repeatedly and creating a new record in form, the product selector is automatically filled 
mov newLine2.mov (849,675) 2015-11-03 10:29
https://issues.openbravo.com/file_download.php?file_id=8679&type=bug
diff issue_31331.diff (8,203) 2015-12-21 13:25
https://issues.openbravo.com/file_download.php?file_id=8832&type=bug
Issue History
2015-11-03 10:29malsasuaNew Issue
2015-11-03 10:29malsasuaAssigned To => platform
2015-11-03 10:29malsasuaFile Added: newLine2.mov
2015-11-03 10:29malsasuaModules => Core
2015-11-03 10:29malsasuaTriggers an Emergency Pack => No
2015-11-03 10:30malsasuaAssigned Toplatform => NaroaIriarte
2015-11-03 13:03alostaleRelationship addedrelated to 0030940
2015-11-03 13:04NaroaIriarteNote Added: 0081447
2015-11-03 13:04NaroaIriarteSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10017#r10017
2015-11-04 09:12alostaleStatusnew => acknowledged
2015-11-10 15:52NaroaIriarteNote Added: 0081658
2015-11-10 15:53NaroaIriarteNote Edited: 0081658bug_revision_view_page.php?bugnote_id=0081658#r10135
2015-11-11 12:13alostaleAssigned ToNaroaIriarte => platform
2015-11-11 12:59alostaleStatusacknowledged => scheduled
2015-11-11 12:59alostaleAssigned Toplatform => NaroaIriarte
2015-11-11 13:36NaroaIriarteRelationship addedrelated to 0031428
2015-11-12 12:25NaroaIriarteRelationship addedrelated to 0031449
2015-12-11 11:17alostaleAssigned ToNaroaIriarte => platform
2015-12-11 11:17alostaleStatusscheduled => acknowledged
2015-12-11 11:17alostalePrioritynormal => urgent
2015-12-11 14:17caristuAssigned Toplatform => caristu
2015-12-11 14:17caristuStatusacknowledged => scheduled
2015-12-18 14:31caristuNote Added: 0082872
2015-12-21 13:23caristuTarget Version => 3.0PR16Q2
2015-12-21 13:25caristuFile Added: issue_31331.diff
2015-12-21 13:25caristuNote Added: 0082884
2015-12-21 13:36VictorVillarResolution time => 1452121200
2016-01-11 19:23hgbotCheckin
2016-01-11 19:23hgbotNote Added: 0083206
2016-01-11 19:23hgbotStatusscheduled => resolved
2016-01-11 19:23hgbotResolutionopen => fixed
2016-01-11 19:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f8951754dc84e01f8de995ebbcc98b35e1e03f74 [^]
2016-01-11 19:24caristuReview Assigned To => alostale
2016-01-11 19:24caristuIssue Monitored: alostale
2016-01-15 11:32alostaleNote Added: 0083341
2016-01-15 11:32alostaleStatusresolved => closed
2016-01-15 11:32alostaleFixed in Version => 3.0PR16Q2
2016-03-17 10:54hudsonbotCheckin
2016-03-17 10:54hudsonbotNote Added: 0085030

Notes
(0081447)
NaroaIriarte   
2015-11-03 13:04   

This is not always reproducible, it is necessary to do the steps 5 and 6 very fast.

It happens too without saving the record in lines and only by clicking the "create a new record in a form" button.
(0081658)
NaroaIriarte   
2015-11-10 15:52   
(edited on: 2015-11-10 15:53)
This is the callstack obtained when the issue is reproducible. The problem is that, when clicking the save button (but the record is still not saved) and the button of create new document is clicked, the methods "SelectDefaultItem" and "SelectSingle" (the first two of the stack) are executed and the result is that the first product of the selector is selected.
 
isc.Selection.addMethods.selectSingle (Selection.js:841)
isc.defineClass.addMethods.selectDefaultItem (ComboBoxItem.js:1162)
isc.defineClass.addMethods._updateValueForFilterComplete (ComboBoxItem.js:892)

isc.PickList.addInterfaceMethods.filterComplete (PickList.js:2109)
isc.defineClass.addMethods.filterComplete (ComboBoxItem.js:853)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
isc.OBComboBoxItem.addProperties.filterComplete (0dd6674effcd5ca…e752d.js:14096)
isc.Class.addClassMethods.fireCallback (Class.js:1789)
isc.Class.addMethods.fireCallback (Class.js:3488)
isc.DataSource.addMethods.fireResponseCallbacks (DataSource.js:13641)
isc.DataSource.addMethods._completeResponseProcessing (DataSource.js:13599)
isc.DataSource.addMethods._handleJSONReply (DataSource.js:11651)
isc.DataSource.addMethods._handleJSONTextReply (DataSource.js:11744)
isc.Class.addClassMethods.fireCallback (Class.js:1789)
isc.Class.addMethods.fireCallback (Class.js:3488)
isc.RPCManager.addClassMethods.fireReplyCallback (RPCManager.js:4273)
isc.RPCManager.addClassMethods.fireReplyCallbacks (RPCManager.js:4336)
isc.RPCManager.addClassMethods.performOperationReply (RPCManager.js:4265)
isc.RPCManager.addClassMethods._performTransactionReply (RPCManager.js:4178)
isc.RPCManager.addClassMethods.performTransactionReply (RPCManager.js:3595)
(anonymous function) (VM33905:3)
isc.Class.addClassMethods.fireCallback (Class.js:1789)
isc.Comm.addClassMethods.performXmlTransactionReply (Comm.js:383)
(anonymous function) (VM33904:3)
isc.Class.addClassMethods.fireCallback (Class.js:1792)
isc.Comm.addClassMethods._fireXMLCallback (Comm.js:85)
loadFunc (Comm.js:303)
XMLHttpRequest.send (async)
isc.Comm.addClassMethods.sendXmlHttpRequest (Comm.js:351)
isc.RPCManager.addClassMethods._sendQueue (RPCManager.js:3365)
isc.RPCManager.addClassMethods.sendQueue (RPCManager.js:3134)
isc.RPCManager.addClassMethods.sendRequest (RPCManager.js:2138)
isc.RPCManager.addClassMethods.sendProxied (RPCManager.js:1956)
isc.DataSource.addMethods.sendDSRequest (DataSource.js:15000)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
isc.OBRestDataSource.addProperties.sendDSRequest (0dd6674effcd5ca…ee752d.js:9745)
isc.DataSource.addMethods.performDSOperation (DataSource.js:14654)
isc.DataSource.addMethods.fetchData (DataSource.js:14061)
isc.ResultSet.addMethods.fetchRemoteData (ResultSet.js:1623)
isc.ResultSet.addMethods._fetchRemoteData (ResultSet.js:1534)
isc.ResultSet.addMethods.getRangePaged (ResultSet.js:3670)
isc.ResultSet.addMethods._getRangePaged (ResultSet.js:3548)
isc.ResultSet.addMethods.getRange (ResultSet.js:1089)
isc.ListGrid.addMethods.requestVisibleRows (ListGrid.js:21689)
isc.Canvas.addProperties.filterWithCriteria (DataBoundComponent.js:3624)
isc.Canvas.addProperties._filter (DataBoundComponent.js:3584)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
isc.ListGrid.addMethods._filter (ListGrid.js:30621)
isc.Canvas.addProperties.filterData (DataBoundComponent.js:3135)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
isc.ListGrid.addMethods.filterData (ListGrid.js:25791)
isc.PickList.addInterfaceMethods.filterDataBoundPickList (PickList.js:2360)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.isc.OBSelectorItem.addProperties.filterDataBoundPickList (0dd6674effcd5ca…e752d.js:58874)
isc.PickList.addInterfaceMethods._filterPickList (PickList.js:1864)
isc.PickList.addInterfaceMethods.filterPickList (PickList.js:1834)
isc.PickList.addInterfaceMethods.setUpPickList (PickList.js:1329)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.isc.OBSelectorItem.addProperties.setUpPickList (0dd6674effcd5ca…e752d.js:58439)
isc.defineClass.addMethods.setValueMap (ComboBoxItem.js:1717)
$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.isc.OBSelectorItem.addProperties.setEntries (0dd6674effcd5ca…e752d.js:58420)
$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.$LAB.script.wait.isc.OBSelectorItem.addProperties.addValueMapEntry (0dd6674effcd5ca…e752d.js:58392)
$LAB.script.wait.$LAB.script.wait.isc.OBViewDataSource.addProperties.transformResponse (0dd6674effcd5ca…e752d.js:29805)
isc.DataSource.addMethods._completeResponseProcessing (DataSource.js:13531)
isc.DataSource.addMethods._handleJSONReply (DataSource.js:11651)
isc.DataSource.addMethods._handleJSONTextReply (DataSource.js:11744)
isc.Class.addClassMethods.fireCallback (Class.js:1789)
isc.Class.addMethods.fireCallback (Class.js:3488)
isc.RPCManager.addClassMethods.fireReplyCallback (RPCManager.js:4273)
isc.RPCManager.addClassMethods.fireReplyCallbacks (RPCManager.js:4336)
isc.RPCManager.addClassMethods.performOperationReply (RPCManager.js:4265)
isc.RPCManager.addClassMethods._performTransactionReply (RPCManager.js:4178)
isc.RPCManager.addClassMethods.performTransactionReply (RPCManager.js:3595)
(anonymous function) (VM33871:3)
isc.Class.addClassMethods.fireCallback (Class.js:1789)
isc.Comm.addClassMethods.performXmlTransactionReply (Comm.js:383)
(anonymous function) (VM33870:3)
isc.Class.addClassMethods.fireCallback (Class.js:1792)
isc.Comm.addClassMethods._fireXMLCallback (Comm.js:85)
loadFunc (Comm.js:303)
XMLHttpRequest.send (async)
isc.Comm.addClassMethods.sendXmlHttpRequest (Comm.js:351)
isc.RPCManager.addClassMethods._sendQueue (RPCManager.js:3365)
isc.RPCManager.addClassMethods.sendQueue (RPCManager.js:3134)
isc.RPCManager.addClassMethods.sendRequest (RPCManager.js:2138)
isc.RPCManager.addClassMethods.sendProxied (RPCManager.js:1956)
isc.DataSource.addMethods.sendDSRequest (DataSource.js:15000)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
isc.OBRestDataSource.addProperties.sendDSRequest (0dd6674effcd5ca…ee752d.js:9745)
isc.DataSource.addMethods.performDSOperation (DataSource.js:14654)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
$LAB.script.wait.$LAB.script.wait.isc.OBViewDataSource.addProperties.performDSOperation (0dd6674effcd5ca…e752d.js:29727)
isc.EditorActionMethods.addInterfaceMethods.saveEditorValues (ActionMethods.js:1168)
isc.EditorActionMethods.addInterfaceMethods.saveData (ActionMethods.js:794)
$LAB.script.wait.$LAB.script.wait.OB.ViewFormProperties.saveRow (0dd6674effcd5ca…e752d.js:36452)
$LAB.script.wait.$LAB.script.wait.isc.OBStandardView.addProperties.saveRow (0dd6674effcd5ca…e752d.js:31953)
isc.OBToolbar.addClassProperties.SAVE_BUTTON_PROPERTIES.action (0dd6674effcd5ca…e752d.js:18985)
isc.StatefulCanvas.addMethods.handleActivate (StatefulCanvas.js:1805)
isc.StatefulCanvas.addMethods.handleClick (StatefulCanvas.js:1822)
isc.Class.addClassMethods.invokeSuper (Class.js:1550)
isc.Class.addClassMethods.Super (Class.js:1368)
isc._commonMenuButtonProperties.handleClick (MenuButton.js:262)
isc.EventHandler.addClassMethods.bubbleEvent (EventHandler.js:4746)
isc.EventHandler.addClassMethods.handleClick (EventHandler.js:2614)
isc.EventHandler.addClassMethods._handleMouseUp (EventHandler.js:2384)
isc.EventHandler.addClassMethods.handleMouseUp (EventHandler.js:2269)
isc.EventHandler.addClassMethods.dispatch (EventHandler.js:6147)
(anonymous function) (VM146:3)

(0082872)
caristu   
2015-12-18 14:31   
Fix pushed to try
(0082884)
caristu   
2015-12-21 13:25   
Attached patch with the solution
(0083206)
hgbot   
2016-01-11 19:23   
Repository: erp/devel/pi
Changeset: f8951754dc84e01f8de995ebbcc98b35e1e03f74
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Jan 11 19:22:20 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f8951754dc84e01f8de995ebbcc98b35e1e03f74 [^]

fixes issue 31331: When add new lines in sales order the product appears filled

Two different flows were resulting in this problem. From one side, if we clicked directly on the new record button quickly after filling the combo value it could happen that the new form was created before the filter operation of the combo finished. To overcome this problem now a temporary id is generated every time we edit/create a new record in form. This id is checked once the combo filter operation ends, to identify if the form has changed. In that case, the flow to be executed after the filter operations is cancelled.

From other side, the same proble could happen if we clicked on the new record button quickly after clicking on the save record button. In this case, it could happen that after clearing the values a wrong entry was retrieved for the combo using the mapValueToDisplay() function. To solve this problem, now in the setEntries() function we include the value field information. This helps to retrieve the correct value on the described circumnstances.

Together with this, a new utility function has been created in order to have a common function to generate 'temporary' ids.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-combo.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
M modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
---
(0083341)
alostale   
2016-01-15 11:32   
code reviewed

tested: couldn't reproduce this (random) issue after the fix is applied
(0085030)
hudsonbot   
2016-03-17 10:54   
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/b22fb0500156 [^]
Maturity status: Test