details:   https://code.openbravo.com/erp/devel/pi/rev/30c40214364b
changeset: 35548:30c40214364b
user:      Mark Molina <mark.molina <at> doceleguas.com>
date:      Thu Mar 14 12:23:44 2019 -0300
summary:   Fixes issue 40190: Not possible to set Attributes opening BackOffice 
from POS

Was not possible to set Attributes opening a BackOffice session from POS because
an incorrect selection of the opener.

Now to select the opener is asked if it has the closeSearch function registered
and also it is included the getFrame('LayoutMDI').parent object for cases where
is coming from POS

diffstat:

 src/org/openbravo/erpCommon/info/AttributeSetInstance.html |  20 +++++++++++--
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r edd10a6633c6 -r 30c40214364b 
src/org/openbravo/erpCommon/info/AttributeSetInstance.html
--- a/src/org/openbravo/erpCommon/info/AttributeSetInstance.html        Thu Mar 
21 17:15:46 2019 +0100
+++ b/src/org/openbravo/erpCommon/info/AttributeSetInstance.html        Thu Mar 
14 12:23:44 2019 -0300
@@ -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) 2001-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2019 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -48,10 +48,24 @@
     if (msg!=null && msg != "") alert(msg);
     var key = document.frmMain.inpInstance.value;
     var text = document.frmMain.inpDescription.value;
-    var theOpener = top.opener || getFrame('LayoutMDI');
+    var theOpener = getOpenerToCloseSearch();
     theOpener.closeSearch("SAVE", key, text, null);
     return true;
 }
+function getOpenerToCloseSearch() {
+    if (top.opener && top.opener.closeSearch) {
+        return top.opener;
+    }
+    if (getFrame('LayoutMDI')) {
+        if (getFrame('LayoutMDI').closeSearch) {
+            return getFrame('LayoutMDI')
+        }
+        if (getFrame('LayoutMDI').parent && 
getFrame('LayoutMDI').parent.closeSearch) {
+            return getFrame('LayoutMDI').parent
+        }
+    }
+    return null;
+}
 </script>
 <script language="JavaScript" type="text/javascript" id="paramScript">
 function onloadFunctions() {
@@ -60,7 +74,7 @@
 </script>
 <script language="JavaScript" type="text/javascript">
 function validateSelector(action) {
-    var theOpener = top.opener || getFrame('LayoutMDI');
+    var theOpener = getOpenerToCloseSearch();
     if (action=="SAVE") {
         if (validate()) {
             submitCommandForm("SAVE");


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to