Related with issue 27787: Create new icon is shown when windows are EditOnly
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Tue, 02 Dec 2014 12:53:17 +0100
changeset 25483 5a8a44dabdce
parent 25482 79198ab4f09b
child 25484 1643c8fecb96
Related with issue 27787: Create new icon is shown when windows are EditOnly

The case of the tab's UI Pattern put as "Edit Only" was not taken in the first fix of the issue.
So that case is fixed now.
When the tab's UI pattern was "Edit Only", the small green icon for "create new" was shown in the
recent views layaout.
For fixing this the "ob-utilities.js" has been changed.
Inside the "{OB.Utilities.openView}" function there was a condition for setting the "singleRecord" value
(that is the Edit Only attribute) of the tab
to true or false, wich was dependent on other condition. It was not correct, because the "singleRecord" value does not depend
on the other condition for being true nor false.
The condition that evaluates the value of "singleRecord" has been moved outside of the other condition.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Mon Dec 01 15:13:04 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Tue Dec 02 12:53:17 2014 +0100
@@ -427,10 +427,12 @@
     if (direct !== false) {
       isDirect = true;
     }
-    if (singleRecord !== false) {
-      isSingleRecord = true;
-    }
+
   }
+  if (singleRecord !== false) {
+    isSingleRecord = true;
+  }
+
   if (isClassicEnvironment) {
     if (recordId) {
       OB.Layout.ClassicOBCompatibility.openLinkedItem(tabId, recordId);