OBGrid.openExpansionProcess example in 'Sales Invoice' window
authorDavid Baz Fayos <david.baz@openbravo.com>
Fri, 04 Jul 2014 19:09:15 +0200
changeset 10 e5f9ca26c46d
parent 9 864850730c57
child 11 19ab5a0a0a73
OBGrid.openExpansionProcess example in 'Sales Invoice' window
src-db/database/sourcedata/AD_FIELD.xml
src/org/openbravo/platform/features/OBPFComponentProvider.java
web/org.openbravo.platform.features/js/OBPF_AddPayment_GridBtn.js
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Jul 03 20:53:11 2014 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Fri Jul 04 19:09:15 2014 +0200
@@ -188,6 +188,33 @@
 <!--7E16E39036FE4D35A100C919BFAA4649-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--7E16E39036FE4D35A100C919BFAA4649--></AD_FIELD>
 
+<!--A1CF453A1E104872A096CA3889BE1B08--><AD_FIELD>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <AD_FIELD_ID><![CDATA[A1CF453A1E104872A096CA3889BE1B08]]></AD_FIELD_ID>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <NAME><![CDATA[Add Payment]]></NAME>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <AD_TAB_ID><![CDATA[263]]></AD_TAB_ID>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <SEQNO><![CDATA[2050]]></SEQNO>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <AD_MODULE_ID><![CDATA[F2E7A973F06D438B85FFFB96E69670D4]]></AD_MODULE_ID>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <GRID_SEQNO><![CDATA[1]]></GRID_SEQNO>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <CLIENTCLASS><![CDATA[OBPF_SalesInvoiceAddPayment]]></CLIENTCLASS>
+<!--A1CF453A1E104872A096CA3889BE1B08-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--A1CF453A1E104872A096CA3889BE1B08--></AD_FIELD>
+
 <!--BAA87FB8664B4D3794133065E8C2ADBF--><AD_FIELD>
 <!--BAA87FB8664B4D3794133065E8C2ADBF-->  <AD_FIELD_ID><![CDATA[BAA87FB8664B4D3794133065E8C2ADBF]]></AD_FIELD_ID>
 <!--BAA87FB8664B4D3794133065E8C2ADBF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/platform/features/OBPFComponentProvider.java	Thu Jul 03 20:53:11 2014 +0200
+++ b/src/org/openbravo/platform/features/OBPFComponentProvider.java	Fri Jul 04 19:09:15 2014 +0200
@@ -38,6 +38,9 @@
     globalResources.add(createStaticResource(
         "web/org.openbravo.platform.features/js/OBPF_BPCreation.js", false));
 
+    globalResources.add(createStaticResource(
+        "web/org.openbravo.platform.features/js/OBPF_AddPayment_GridBtn.js", false));
+
     return globalResources;
   }
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/org.openbravo.platform.features/js/OBPF_AddPayment_GridBtn.js	Fri Jul 04 19:09:15 2014 +0200
@@ -0,0 +1,52 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2014 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+
+OB.OBPF = OB.OBPF || {};
+
+isc.defineClass('OBPF_SalesInvoiceAddPayment', isc.OBGridFormButton);
+
+isc.OBPF_SalesInvoiceAddPayment.addProperties({
+  canExpandRecord: true,
+  noTitle: true,
+  title: OB.I18N.getLabel('APRM_AddPaymentIn'),
+  draw: function () {
+    if (this.record && this.record.paymentComplete === false) {
+      return this.Super('draw', arguments);
+    } else {
+      return false;
+    }
+  },
+  click: function () {
+    var processId = '9BED7889E1034FE68BD85D5D16857320',
+        grid = this.grid,
+        record = this.record,
+        standardWindow = grid.view.standardWindow;
+
+    var process = standardWindow.buildProcess({
+      callerField: this,
+      paramWindow: true,
+      processId: processId,
+      windowId: grid.view.windowId,
+      windowTitle: OB.I18N.getLabel('APRM_AddPaymentIn')
+    });
+
+    grid.openExpansionProcess(process, record);
+
+  }
+});
\ No newline at end of file