details: https://code.openbravo.com/erp/devel/pi/rev/50e5345f5a57
changeset: 26094:50e5345f5a57
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Fri Feb 27 14:30:15 2015 +0100
summary: Fixes bug 28870: Callouts are run when moving from grid to form with
a shortcut
When a dynamic column is modified, a call is done to the FIC to run the
callouts. The list of dynamic columns is stored in the form (in the view form
and also in the grid edit form), and is loaded from the
FIC response. For instance, when a record is created (either or grid or form
view), a call is done to the FIC in NEW mode, and the dynamicCols list is
initialized.
The cause of this issue is that it was possible to open a record in form view
in an inconsistent state, having the form's dynamicCols list not set. In this
state the callouts are not run. To get to this in
consistent state, the following steps should take place:
- The user creates a record in the grid (a call to the FIC in NEW mode is done,
and the dynamicCols list of the grid edit form is initialized)
- Without saving, the user presses Ctrl+F2 to edit the record in form view. No
FIC call is done (there is no need for it), so even though the record is shown
in the form view, its dynamicCols list is not s
et. The callouts will not run until a call to the FIC is done (for instance by
refreshing the record).
To fix this, the list of dynamicCols of the grid edit form is copied to the
form view. This is done in the ksAction_EditInForm function, which is the
function executed when the user presses Ctrl+F2 to move
from the grid view to the form view.
The list of dynamic columns returned from the FIC to the grid view is the same
as the one returned from the FIC to the form view, so it is not a problem is a
dynamic columns is shown in the form view but n
ot in the grid view.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
| 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diffs (15 lines):
diff -r 452fedf8a214 -r 50e5345f5a57
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Thu Feb 26 13:37:44 2015 -0500
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Fri Feb 27 14:30:15 2015 +0100
@@ -1450,6 +1450,11 @@
autoSaveEditsBackup = me.autoSaveEdits,
recordToEdit, originalValuesOfEditedRow;
if (me.getSelectedRecords().length === 1) {
+ if (me.getEditForm() && me.view && me.view.viewForm) {
+ // copy the list of dynamicCols to the viewForm, as otherwise they
will not be set until for form
+ // makes a call to the FIC (see issue
https://issues.openbravo.com/view.php?id=28870)
+ me.view.viewForm.dynamicCols = me.getEditForm().dynamicCols;
+ }
if (me.view.isEditingGrid) {
// do not save the provisional changes
me.autoSaveEdits = false;
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits