details: https://code.openbravo.com/erp/devel/pi/rev/f5ba40a7b69e changeset: 23078:f5ba40a7b69e user: Guillermo Gil <guillermo.gil <at> openbravo.com> date: Tue May 20 16:14:19 2014 +0200 summary: Fixed issue 26623:Canvas fields are not working properly on pick and execute
Modified createRecordComponent for the pick and execute windows details: https://code.openbravo.com/erp/devel/pi/rev/016a009f0d6c changeset: 23079:016a009f0d6c user: Guillermo Gil <guillermo.gil <at> openbravo.com> date: Tue May 20 16:15:53 2014 +0200 summary: Fixed issue 26628: Unexpected behavior after completing an invoice Added structure to execute autosave if the record is newand it has not been modified diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js | 22 ++++++++- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js | 14 ------ 2 files changed, 18 insertions(+), 18 deletions(-) diffs (72 lines): diff -r 3583bc1b3338 -r 016a009f0d6c modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js Tue May 20 15:52:55 2014 +0000 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js Tue May 20 16:15:53 2014 +0200 @@ -717,9 +717,10 @@ saveCallback; saveCallback = function (ok) { + var dirtyEditForm = me.getDirtyEditForm(); if (!ok) { - if (me.getDirtyEditForm()) { - me.getDirtyEditForm().resetForm(); + if (dirtyEditForm) { + dirtyEditForm.resetForm(); } if (action) { OB.Utilities.callAction(action); @@ -727,8 +728,21 @@ return; } + // If me.getDirtyEditForm() is undefined -> only for new created records that have not been modified + // See issue https://issues.openbravo.com/view.php?id=26628 + if (!dirtyEditForm) { + if (me.activeView && !me.activeView.isShowingForm) { + // Look if the record is new + if (me.activeView.viewGrid.getEditForm() && me.activeView.viewGrid.getEditForm().isNew) { + // Set a new dirtyEditForm + dirtyEditForm = me.activeView.viewGrid.getEditForm(); + } + } + } + + // if not dirty or we know that the object has errors - if (!me.getDirtyEditForm() || (me.getDirtyEditForm() && !me.getDirtyEditForm().validateForm())) { + if (!dirtyEditForm || (dirtyEditForm && !dirtyEditForm.validateForm())) { // clean up before calling the action, as the action // can set dirty form again me.cleanUpAutoSaveProperties(); @@ -754,7 +768,7 @@ me.isAutoSaving = true; me.forceDialogOnFailure = forceDialogOnFailure; - me.getDirtyEditForm().autoSave(); + dirtyEditForm.autoSave(); }; if (this.getClass().autoSave && this.getClass().showAutoSaveConfirmation) { diff -r 3583bc1b3338 -r 016a009f0d6c modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js Tue May 20 15:52:55 2014 +0000 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js Tue May 20 16:15:53 2014 +0200 @@ -392,20 +392,6 @@ return this.Super('recordClick', arguments); }, - - // Dummy "createRecordComponent" to fix issue: https://issues.openbravo.com/view.php?id=19879 - // It seems that if it is not present, Smartclient doesn't perform well the maths to calculate the editing fields width - createRecordComponent: function (record, colNum) { - var layout = null; - if (colNum === 0) { - layout = isc.Layout.create({ - width: 0, - height: 0 - }); - } - return layout; - }, - getOrgParameter: function () { var view = this.view && this.view.buttonOwnerView, context, i; ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
