Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028309Openbravo ERPB. User interfacepublic2014-11-27 19:102014-12-30 23:26
caristu 
AugustoMauch 
highminoralways
closedfixed 
5
 
3.0PR15Q23.0PR15Q1 
alostale
Core
No
0028309: Wrong behavior with Create One link and Switch to form view shortcut
Wrong behavior with Create One link and Switch to form view shortcut
1) Go to the [Sales Invoice] window and create a new record in the header
2) Go to the [Lines] tab. Click on the "Create One" link
3) Without saving the record, switch to form by typing Ctrl + F2. Save the record in form view.
4) Close the form view. Notice that two records has been created. This is wrong.
5) Edit the new created record in grid view and type Ctrl + F2, change any field in form view and save. The following error appears: "Saving failed. Exception when updating InvoiceLine(null)"
6) If you repeat step 5) the error doesn't happen again.
No tags attached.
related to defect 0028321 closed caristu Request without pagination when refreshing the grid 
related to defect 0021715 acknowledged Triage Platform Base Opening a new record in form while editing a record in grid generates inconsistencies 
related to defect 00288703.0PR15Q3 closed AugustoMauch Callouts are not executed when using a keyboard shortcut to create a new record under some circumnstances 
Issue History
2014-11-27 19:10caristuNew Issue
2014-11-27 19:10caristuAssigned To => AugustoMauch
2014-11-27 19:10caristuModules => Core
2014-11-27 19:10caristuResolution time => 1423609200
2014-11-27 19:10caristuTriggers an Emergency Pack => No
2014-11-27 19:10caristuIssue Monitored: networkb
2014-11-28 09:05alostaleNote Added: 0072094
2014-11-28 13:37AugustoMauchRelationship addedrelated to 0028321
2014-12-01 13:38egoitzTarget Version3.0PR15Q1 => 3.0PR15Q2
2014-12-02 17:05AugustoMauchIssue Monitored: alostale
2014-12-02 17:06AugustoMauchReview Assigned To => alostale
2014-12-02 17:07hgbotCheckin
2014-12-02 17:07hgbotNote Added: 0072241
2014-12-02 17:07hgbotStatusnew => resolved
2014-12-02 17:07hgbotResolutionopen => fixed
2014-12-02 17:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e976b465ba654a7f7b109b8c139f02d85bf37c07 [^]
2014-12-03 10:00alostaleNote Added: 0072259
2014-12-03 10:00alostaleStatusresolved => new
2014-12-03 10:00alostaleResolutionfixed => open
2014-12-03 10:20alostaleNote Edited: 0072259bug_revision_view_page.php?bugnote_id=0072259#r7207
2014-12-03 10:20alostaleNote Added: 0072260
2014-12-04 17:00hgbotCheckin
2014-12-04 17:00hgbotNote Added: 0072286
2014-12-04 17:00hgbotStatusnew => resolved
2014-12-04 17:00hgbotResolutionopen => fixed
2014-12-04 17:00hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/e976b465ba654a7f7b109b8c139f02d85bf37c07 [^] => http://code.openbravo.com/erp/devel/pi/rev/3ccddc39ff88aa25eaf2d343a9d488b2b96605f4 [^]
2014-12-10 13:04alostaleNote Added: 0072394
2014-12-10 13:04alostaleStatusresolved => closed
2014-12-10 13:04alostaleFixed in Version => 3.0PR15Q1
2014-12-10 15:34alostaleRelationship addedrelated to 0021715
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073162
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073173
2015-02-05 12:29caristuRelationship addedrelated to 0028870

Notes
(0072094)
alostale   
2014-11-28 09:05   
In Sales Invoice, ctrl+F2 executes a PUT request to datasorce saving the new record.

In Sales Order > Lines, ctr+F2 just after the record creation does not triggers the save because not all mandatory fields are pouplated. But if after creating the new line, product field is filled, it behaves in the same way as described in the issue.
(0072241)
hgbot   
2014-12-02 17:07   
Repository: erp/devel/pi
Changeset: e976b465ba654a7f7b109b8c139f02d85bf37c07
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Dec 02 17:05:27 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e976b465ba654a7f7b109b8c139f02d85bf37c07 [^]

Fixes bug 28309: Editing a record that was just created in grid works properly

There were two problems when a record that was being created in the grid was opened in form view (the only way to do this is by pressing Ctrl+<F2> while creating the record):
- If the user had not entered all the mandatory fields in the grid, then after saving the record was saved in the form view, two new record would appear in the grid
- If the user had entered all the mandatory fields in the grid before pressing <F2>, then the record would be saved in the database before being open in form view.

To fix this, when a record that is being created in grid view is opened in form view by pressing <F2>:
- The record is not saved even if all the mandatory fields had been entered
- No FIC request in NEW mode is done

After doing this there were two problems:
- The valuemaps were not properly loaded in the form view. To fix this, they are copied from the grid edit form to the form view
- If the addition was canceled in the form view, an empty row would be shown in grid view. To fix this, that empty line is removed from the grid view when the addition is cancelled.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.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
---
(0072259)
alostale   
2014-12-03 10:00   
(edited on: 2014-12-03 10:20)
Reopening due to some cases not working correctly:

Test cases, executed in Sales Invoice Lines tab

== Creating new record in grid ==
1. new record, CTL+F2 just after creating -> moves to form view -> OK
2. new record, edit product CTL+F2 -> moves to form, edited product is preserved -> OK
3. new record, CTL+F2, cancel changes button in toolbar -> goes back to grid no new record appears -> OK
4. new record, CTL+F2, close current record with X in status bar -> a new line in grid is shown with all its fields empty -> FAIL. It should behave in the same way as when creating new in form: if the button is clicked just after creating without any change, just cancel the changes and go back to grid; if there were changes try to save before moving to grid, if not possible to save, stay in form view

== Editing existent record in grid ==
1. remove line No value, CTL+F2 -> moves to form view, line no is empty -> OK
2. change invoiced qty, CTL+F2, cancel changes -> edited qty is kept, though when refreshing the record original qty is retrieved -> FAIL, original qty should be seen in UI
2.a. If in this situation, after refreshing the record, there is a switch back to the grid, a new empty line is shown -> FAIL

(0072260)
alostale   
2014-12-03 10:20   
Test case created in TestLink: http://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-7979 [^]
(0072286)
hgbot   
2014-12-04 17:00   
Repository: erp/devel/pi
Changeset: 3ccddc39ff88aa25eaf2d343a9d488b2b96605f4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Dec 04 16:58:28 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3ccddc39ff88aa25eaf2d343a9d488b2b96605f4 [^]

Fixes issue 28309: Editing a record in form by pressing Ctrl+F2 works properly

Three changes have been done:
- When the record edition is canceled in the form view by pressing the Cancel toolbar button, the values restored are the unedited values, not the values from the edited grid row. These original values are
 saved in the action of the Ctrl+<F2> shortcut, and removed when other record is edited in form view.
- When the X button is pressed in form view on an unsaved row that was originally created in grid view, the record is deleted from the grid view.
- When an existing row is modified in grid view, then showed in form view, and its changes canceled, both the form view and the grid view show the values previous to the edition.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0072394)
alostale   
2014-12-10 13:04   
Code reviewed

Tested all cases explained above.
(0073162)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test
(0073173)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test