details:   https://code.openbravo.com/erp/devel/pi/rev/1b9a1df0a891
changeset: 20151:1b9a1df0a891
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Fri Apr 19 15:55:25 2013 +0200
summary:   Fixed issue 23595: 'Copy record' toolbar button now only is
available when the record has not been edited

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
 |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 3f93afd1a9f2 -r 1b9a1df0a891 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Fri Apr 19 14:11:18 2013 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Fri Apr 19 15:55:25 2013 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):   Sreedhar Sirigiri (TDS), Mallikarjun M (TDS)
  ************************************************************************
@@ -497,7 +497,7 @@
 
   CLONE_BUTTON_PROPERTIES: {
     action: function () {
-      alert('this method must be overridden when registering the button');
+      alert('This method must be overridden when registering the button');
     },
     disabled: false,
     buttonType: 'clone',
@@ -507,12 +507,15 @@
           form = view.viewForm,
           grid = view.viewGrid,
           selectedRecords = grid.getSelectedRecords();
+
       if (selectedRecords && selectedRecords.length > 1) {
         this.setDisabled(true);
       } else if (view.isShowingForm && form.isNew) {
         this.setDisabled(true);
       } else if (view.isEditingGrid && grid.getEditForm().isNew) {
         this.setDisabled(true);
+      } else if (form.hasChanged || (view.isEditingGrid && 
grid.getEditForm().hasChanged)) {
+        this.setDisabled(true);
       } else {
         this.setDisabled(selectedRecords.length === 0);
       }

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to