fixes issue 21263: Error when navigating from Maintenance Plan
authorCarlos Aristu <carlos.aristu@openbravo.com>
Tue, 28 Aug 2012 08:21:23 +0200
changeset 17795 fd8adf4c91f8
parent 17794 8d97dad9745c
child 17796 a0958de2d54d
fixes issue 21263: Error when navigating from Maintenance Plan
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_TABLE.xml
src/org/openbravo/erpCommon/ad_callouts/SL_ScheduledMaintenance_Maintenance.java
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Mon Aug 27 14:51:48 2012 +0200
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Tue Aug 28 08:21:23 2012 +0200
@@ -1275,6 +1275,18 @@
 <!--5BAAD3A90DD249B1ACCFAD81E03144C3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5BAAD3A90DD249B1ACCFAD81E03144C3--></AD_AUXILIARINPUT>
 
+<!--5C17038A0D494AF591B907104586C9B6--><AD_AUXILIARINPUT>
+<!--5C17038A0D494AF591B907104586C9B6-->  <AD_AUXILIARINPUT_ID><![CDATA[5C17038A0D494AF591B907104586C9B6]]></AD_AUXILIARINPUT_ID>
+<!--5C17038A0D494AF591B907104586C9B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5C17038A0D494AF591B907104586C9B6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5C17038A0D494AF591B907104586C9B6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5C17038A0D494AF591B907104586C9B6-->  <AD_TAB_ID><![CDATA[800188]]></AD_TAB_ID>
+<!--5C17038A0D494AF591B907104586C9B6-->  <NAME><![CDATA[IsSOTrx]]></NAME>
+<!--5C17038A0D494AF591B907104586C9B6-->  <CODE><![CDATA[@SQL=SELECT CASE WHEN MA_MACHINE_ID IS NULL THEN 'N' ELSE 'Y' END FROM MA_MAINTENANCE 
+WHERE MA_MAINTENANCE_ID = @MA_MAINTENANCE_ID@]]></CODE>
+<!--5C17038A0D494AF591B907104586C9B6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5C17038A0D494AF591B907104586C9B6--></AD_AUXILIARINPUT>
+
 <!--5EE498F6C1484535A77A8CE36D96C77B--><AD_AUXILIARINPUT>
 <!--5EE498F6C1484535A77A8CE36D96C77B-->  <AD_AUXILIARINPUT_ID><![CDATA[5EE498F6C1484535A77A8CE36D96C77B]]></AD_AUXILIARINPUT_ID>
 <!--5EE498F6C1484535A77A8CE36D96C77B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Mon Aug 27 14:51:48 2012 +0200
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Tue Aug 28 08:21:23 2012 +0200
@@ -6353,6 +6353,7 @@
 <!--800159-->  <ISHIGHVOLUME><![CDATA[N]]></ISHIGHVOLUME>
 <!--800159-->  <IMPORTTABLE><![CDATA[N]]></IMPORTTABLE>
 <!--800159-->  <ISCHANGELOG><![CDATA[N]]></ISCHANGELOG>
+<!--800159-->  <PO_WINDOW_ID><![CDATA[800071]]></PO_WINDOW_ID>
 <!--800159-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--800159-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--800159-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1EA4B84E040007F01006125]]></AD_PACKAGE_ID>
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_ScheduledMaintenance_Maintenance.java	Mon Aug 27 14:51:48 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_ScheduledMaintenance_Maintenance.java	Tue Aug 28 08:21:23 2012 +0200
@@ -73,6 +73,11 @@
     if (strMaintenance != null && !strMaintenance.equals("")) {
       SLScheduledMaintenanceMaintenanceData[] data = SLScheduledMaintenanceMaintenanceData.select(
           this, strMaintenance);
+      String strWindowId = vars.getStringParameter("inpwindowId");
+      if (data[0].maMachineId.equals(""))
+        vars.setSessionValue(strWindowId + "|IsSOTrx", "N");
+      else
+        vars.setSessionValue(strWindowId + "|IsSOTrx", "Y");
       resultado.append("new Array(\"inpmaMaintOperationId\", \"" + data[0].maMaintOperationId
           + "\"),\n");
       resultado.append("new Array(\"inpMaintenanceType\", \""