fixes issue 33736: 'Disable Notes For Read-Only' tabs not working properly
authorCarlos Aristu <carlos.aristu@openbravo.com>
Mon, 22 Aug 2016 11:13:39 +0200
changeset 30116 bc2fbf3adc36
parent 30115 9ba575b5bb40
child 30117 18744d5df2a4
child 30119 1b4c4167570a
fixes issue 33736: 'Disable Notes For Read-Only' tabs not working properly

'Disable Notes For Read-Only' preference was not working properly when a window was set in the visibility settings. This is because the window ID was not being retrieved properly within the OBNoteSectionItem class.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js	Wed Aug 17 15:35:33 2016 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js	Mon Aug 22 11:13:39 2016 +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) 2011-2015 Openbravo SLU
+ * All portions are Copyright (C) 2011-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s): Valery Lezhebokov.
  ************************************************************************
@@ -292,8 +292,9 @@
           return this.Super('change', arguments);
         },
         isDisabled: function () {
+          var windowId = view.standardWindow ? view.standardWindow.windowId : null;
           this.Super('isDisabled', arguments);
-          if (OB.PropertyStore.get("DisableNotesForReadOnlyTabs", this.windowId) === 'Y' && view.readOnly === true) {
+          if (OB.PropertyStore.get("DisableNotesForReadOnlyTabs", windowId) === 'Y' && view.readOnly === true) {
             this.readOnly = true;
             this.canEdit = false;
           }