Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030783Openbravo ERPA. Platformpublic2015-09-07 15:512015-11-23 21:16
alostale 
NaroaIriarte 
urgentminoralways
closedfixed 
5
 
3.0PR16Q1 
alostale
Core
No
0030783: reduce the number of clicks to print documents
When printing documents (ie. Sales Order) several clicks need to be performed in order to get the final printed document.

This can be annoying when it needs to be repeated quite often.
Open a Sales Order:

1. Click on print button in toolbar
2. Decide whether document is going to be saved as attachment
3. Open downloaded document with a pdf viewer
4. Open print dialog
5. Click on print option
Define 2 new preferences:

1. Save as attachment. When it is defined (Y/N), popup asking if the document will be attached will be bypassed, so 2nd click will be saved.
2. Direct print. When it is defined, the document will not be downloaded but instead the browser's print dialog will be shown allowing to print the document.

Having these 2 new preferences configured the flow to print would be reduced to 2 clicks:

1. Click on print button in toolbar
2. Click print in the browser's print dialog
No tags attached.
has duplicate feature request 0025722 closed AugustoMauch Ability to hide the previous pop-up when printing a document 
related to feature request 0023249 new Triage Platform Base It would be great to have the possibility of printing the reports directly to a printer 
related to defect 0031317 closed NaroaIriarte Unexpected error thrown in the log having the Direct Print preference enabled 
related to defect 0031397 closed platform Direct Print is not working on MS Edge 
causes defect 0031344 closed NaroaIriarte The email option does not work if the Attach by default preference is set. 
causes defect 0032541 closed caristu invoice report can not be printed by manual roles 
causes defect 0033222 closed caristu ConcatPDFReport has a null pointer exception if is used without reportConfiguration parameter 
diff issue30783.diff (17,073) 2015-09-25 09:50
https://issues.openbravo.com/file_download.php?file_id=8483&type=bug
Issue History
2015-09-07 15:51alostaleNew Issue
2015-09-07 15:51alostaleAssigned To => platform
2015-09-07 15:51alostaleModules => Core
2015-09-07 15:51alostaleTriggers an Emergency Pack => No
2015-09-07 15:51alostaleStatusnew => scheduled
2015-09-07 15:51alostaleAssigned Toplatform => NaroaIriarte
2015-09-08 12:01VictorVillarResolution time => 1442527200
2015-09-08 12:01VictorVillarReproducibilityN/A => always
2015-09-14 17:24ngarciaIssue Monitored: ngarcia
2015-09-14 17:24ngarciaRelationship addedrelated to 0023249
2015-09-25 09:50NaroaIriarteFile Added: issue30783.diff
2015-09-25 09:51NaroaIriarteNote Added: 0080635
2015-09-28 17:07NaroaIriarteNote Added: 0080671
2015-10-27 15:03hgbotCheckin
2015-10-27 15:03hgbotNote Added: 0081353
2015-10-27 15:03hgbotStatusscheduled => resolved
2015-10-27 15:03hgbotResolutionopen => fixed
2015-10-27 15:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cbf2d65774b8afda5265c76b78642271a0a7246a [^]
2015-10-28 08:16alostaleReview Assigned To => alostale
2015-10-28 08:29alostaleNote Edited: 0080671bug_revision_view_page.php?bugnote_id=0080671#r9945
2015-10-28 08:32alostaleNote Added: 0081361
2015-10-28 08:32alostaleStatusresolved => closed
2015-10-28 08:32alostaleFixed in Version => 3.0PR16Q1
2015-10-28 09:08caristuRelationship addedhas duplicate 0025722
2015-10-28 09:24NaroaIriarteNote Added: 0081364
2015-10-30 14:26caristuRelationship addedrelated to 0031317
2015-11-03 17:41NaroaIriarteRelationship addedcauses 0031344
2015-11-06 15:18caristuRelationship addedrelated to 0031397
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082161
2016-03-23 15:57caristuRelationship addedcauses 0032541
2016-06-13 08:52caristuRelationship addedcauses 0033222

Notes
(0080635)
NaroaIriarte   
2015-09-25 09:51   
The diff "issue30783.diff" has been attached with the fix of the issue.
(0080671)
NaroaIriarte   
2015-09-28 17:07   
(edited on: 2015-10-28 08:29)
The documentation of this issue:

http://wiki.openbravo.com/wiki/Preference#Preferences_Definition [^]
https://docs.google.com/a/openbravo.com/document/d/1Ju_QMLVAz0QbLkTunuezqHcFzuFNcrB3w2V560ODoyc/edit?usp=sharing [^]

(0081353)
hgbot   
2015-10-27 15:03   
Repository: erp/devel/pi
Changeset: cbf2d65774b8afda5265c76b78642271a0a7246a
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Tue Oct 27 11:20:34 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cbf2d65774b8afda5265c76b78642271a0a7246a [^]

Fixed issue 30783: Reduce the number of clicks to print Documents.

Before, when a document was going to be printed, several clicks were needed.
That was because when you click on the print button, a popup which asks if
you wanted to attach the document or just print it appear, and after it was possible to print.

The number of clicks needed for that task could be bothering if it was often repeated:.

To fix this two new preferences have been added.
The first one "Attach by default": If this preference is set to "N" then, the popup is not
shown when clicking the print button, and the document is not attached.
If this preference is set to "Y" then, the popup is not shown when clicking the print button
and the document is attached.
If this preference is undefined, then, the popup which asks for attaching the document or just printing
it appears when clicking the print button.

The other preference "Direct Print": If this is set as "Y" then the printing popup will be
opened.
If this is set as "N" or undefined, then the document is downloaded, but the printing popup is not shown.
The "ReportingUtils.java" has been modified, now if the direct print preference is set, the "this.print()" js function
is executed.
The "PrinterReports.java" has been modified for handling the new functionality with the preference which
attaches the documents directly.
The "PrintController.java" has been modified for handling the new functionality with the Direct print
preference.

The index.jsp has been changed because there was a problem with some browsers and the "Direct print" preference
it was not possible to display the printer popup in Internet Explorer nor Firefox.
This was because we were using a hidden frame for putting the pdf there. Chrome was able to take what there was in
that frame, but Firefox and Internet Explorer were not able.
To fix this the style="display:none" of the frame "background_target" has been removed.
Now, it is possible to use the Direct Print preference in the Firefox, Safari, Internet Explorer and Chrome browsers.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java
M src-db/database/sourcedata/AD_REF_LIST.xml
M src/index.jsp
M src/org/openbravo/erpCommon/businessUtility/PrinterReports.java
M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
---
(0081361)
alostale   
2015-10-28 08:32   
code reviewed

tested:
* Both new preferences (Attach By Default and Direct Print) are working as expected with any combination of them
* Single and multiple documents are correctly genenerated
(0081364)
NaroaIriarte   
2015-10-28 09:24   
Some tests have been added to testlink:
https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9882 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9883 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9884 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9885 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9886 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9887 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9888 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9889 [^]
(0082161)
hudsonbot   
2015-11-23 21:16   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7b56bebaaa88 [^]
Maturity status: Test