fixed bug 32491: lines removed after printing header with a non-matching filter
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 18 Mar 2016 11:09:24 +0100
changeset 28823 a160b8263357
parent 28822 21b2b9f69f1d
child 28825 6faaf3bc09ce
fixed bug 32491: lines removed after printing header with a non-matching filter

After printing a document that does not match grid's current filter, its lines
were removed from grid.

After printing a refresh is done, the problem is the refresh was done not for
the current printed record but for the whole grid, being discarded current if
not matching filter crieria.

Now in case a single record is selected, it is refreshed only this one regardless
applied filtering criteria.
src/org/openbravo/erpCommon/utility/reporting/printing/PrintOptions.html
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintOptions.html	Fri Mar 18 09:24:44 2016 +0100
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintOptions.html	Fri Mar 18 11:09:24 2016 +0100
@@ -13,7 +13,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) 2008-2013 Openbravo SLU
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -65,7 +65,11 @@
           //We refresh the main view to ensure that the attachments counter is updated
         var tabSet = getFrame('LayoutMDI').OB.MainView.TabSet;
         if (tabSet && tabSet.getSelectedTab() && tabSet.getSelectedTab().pane.view && tabSet.getSelectedTab().pane.view.refresh) {
-          tabSet.getSelectedTab().pane.view.refresh();
+          if (tabSet.getSelectedTab().pane.view.viewGrid.getSelectedRecords().length > 1) {
+            tabSet.getSelectedTab().pane.view.refresh();
+          } else {
+            tabSet.getSelectedTab().pane.view.refreshCurrentRecord ? tabSet.getSelectedTab().pane.view.refreshCurrentRecord():tabSet.getSelectedTab().pane.view.refresh();
+          }
         }
       }
       closePage();