# HG changeset patch
# User Augusto Mauch <augusto.mauch@openbravo.com>
# Date 1412090115 -7200
#      Tue Sep 30 17:15:15 2014 +0200
# Node ID bf15ffb120c57f88c6cfccbcc7abeb19f0de8b5c
# Parent  740ed8bc0a691e105e45ff066d8d03acb44228df
Fixes issue 27710: Fixes problem defining Field Access for process buttons

The problem was that if several process buttons were defined as not editable in the Field Access tab, then in the subtabs of the tab that own the issue only one of them was being set as read only. This happened because when the button being set as read only was looked for in the subtabs, the property of the button in the main tab was not being compared with the property of the button in the subtab, so the first one disabled was picked.

diff --git a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js b/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
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
@@ -498,7 +498,7 @@
                 }
                 for (stBtns = 0; stBtns < stView.toolBar.rightMembers.length; stBtns++) {
                   stBtn = stView.toolBar.rightMembers[stBtns];
-                  if (stBtn.contextView === button.contextView && stBtn.property && !tab.fields[stBtn.property]) {
+                  if (stBtn.contextView === button.contextView && button.property === stBtn.property && !tab.fields[stBtn.property]) {
                     stBtn.readOnlyIf = alwaysReadOnly;
                     break;
                   }
