Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031317Openbravo ERPA. Platformpublic2015-10-30 14:252015-11-23 21:17
caristu 
NaroaIriarte 
immediateminoralways
closedfixed 
5
 
3.0PR16Q1 
caristu
Core
Coding ( Testing )
2015-10-27
pi
http://code.openbravo.com/erp/devel/pi/rev/cbf2d65774b8afda5265c76b78642271a0a7246a [^]
No
0031317: Unexpected error thrown in the log having the Direct Print preference enabled
The following error is raised in the log having the Direct Print preference enabled:

ERROR org.openbravo.erpCommon.utility.reporting.printing.PrintOrders - Error captured:
javax.servlet.ServletException: Configuration Error no sender defined
    at org.openbravo.erpCommon.utility.reporting.printing.PrintController.post(PrintController.java:291)
    at org.openbravo.erpCommon.utility.reporting.printing.PrintOrders.doPost(PrintOrders.java:55)
    at org.openbravo.base.HttpBaseServlet.doGet(HttpBaseServlet.java:280)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
1) Go to the [Preference] window and create a new record with the following information:

  - Property: Direct Print
  - Value: Y
  - Window: Sales Order
  - User: Openbravo

2) Log-out and log-in with Openbravo user.
3) Go to the [Sales Order] window, select any record in the header.
4) Click on the print button of the toolbar
This is caused because having this preference enabled, in the PrintController class the getServletPath() of the request does not contain "print.html" but "printoptions.html". So the servlet is interpreting that we are trying to email the document because of this:

request.getServletPath().toLowerCase().indexOf("print.html")

Proposed fix attached.
No tags attached.
related to feature request 0030783 closed NaroaIriarte reduce the number of clicks to print documents 
related to defect 0031344 closed NaroaIriarte The email option does not work if the Attach by default preference is set. 
diff issue31317.diff (2,030) 2015-10-30 14:50
https://issues.openbravo.com/file_download.php?file_id=8670&type=bug
Issue History
2015-10-30 14:25caristuNew Issue
2015-10-30 14:25caristuAssigned To => caristu
2015-10-30 14:25caristuModules => Core
2015-10-30 14:25caristuTriggers an Emergency Pack => No
2015-10-30 14:26caristuRelationship addedrelated to 0030783
2015-10-30 14:28caristuAssigned Tocaristu => platform
2015-10-30 14:50caristuFile Added: issue31317.diff
2015-10-30 14:50caristuProposed Solution updated
2015-10-30 14:52caristuProposed Solution updated
2015-11-02 13:33alostaleAssigned Toplatform => NaroaIriarte
2015-11-02 13:33alostalePrioritynormal => immediate
2015-11-02 13:33alostaleStatusnew => acknowledged
2015-11-02 13:35alostaleRegression level => Coding ( Testing )
2015-11-02 13:35alostaleRegression date => 2015-10-27
2015-11-02 13:35alostaleRegression introduced in release => pi
2015-11-02 13:35alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/cbf2d65774b8afda5265c76b78642271a0a7246a [^]
2015-11-02 13:36alostaleStatusacknowledged => scheduled
2015-11-03 17:41NaroaIriarteRelationship addedrelated to 0031344
2015-11-04 09:01hgbotCheckin
2015-11-04 09:01hgbotNote Added: 0081459
2015-11-04 09:01hgbotStatusscheduled => resolved
2015-11-04 09:01hgbotResolutionopen => fixed
2015-11-04 09:01hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8834bc491f13275f291dfe0f4b5f9fed3bd3c302 [^]
2015-11-04 09:16alostaleReview Assigned To => alostale
2015-11-09 09:52alostaleReview Assigned Toalostale => caristu
2015-11-09 10:24caristuNote Added: 0081611
2015-11-09 10:28caristuNote Added: 0081612
2015-11-09 10:28caristuStatusresolved => new
2015-11-09 10:28caristuResolutionfixed => open
2015-11-09 17:04hgbotCheckin
2015-11-09 17:04hgbotNote Added: 0081629
2015-11-10 09:43NaroaIriarteStatusnew => scheduled
2015-11-10 09:43NaroaIriarteStatusscheduled => resolved
2015-11-10 09:43NaroaIriarteFixed in Version => pi
2015-11-10 09:43NaroaIriarteResolutionopen => fixed
2015-11-10 13:02caristuNote Added: 0081646
2015-11-10 13:02caristuStatusresolved => closed
2015-11-10 13:02caristuFixed in Versionpi => 3.0PR16Q1
2015-11-10 13:02caristuNote Edited: 0081646bug_revision_view_page.php?bugnote_id=0081646#r10120
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082170
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082190

Notes
(0081459)
hgbot   
2015-11-04 09:01   
Repository: erp/devel/pi
Changeset: 8834bc491f13275f291dfe0f4b5f9fed3bd3c302
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Tue Nov 03 18:00:53 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8834bc491f13275f291dfe0f4b5f9fed3bd3c302 [^]

Fixed issue 31317: The error shown in the log is fixed.

There was an error shown in the log because the servlet was interpreting that it was an email.
That was caused because a condition was not taking into account nothing else but the request.getServletPath as
"print.html".
This has been changed and now "printoptions.html" is taken into account.

---
M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
---
(0081611)
caristu   
2015-11-09 10:24   
This check when the input command is ADD should be removed:

else if (request.getServletPath().toLowerCase().indexOf(SEND_PATH) != -1) {

Because it is causing the add attachment feature on emailing to stop working.
(0081612)
caristu   
2015-11-09 10:28   
Reopening to delete the (not needed) check for "ADD" command on PrintController.
(0081629)
hgbot   
2015-11-09 17:04   
Repository: erp/devel/pi
Changeset: 710400f712640e3e88b904d32a7bb8e508014c22
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon Nov 09 12:58:54 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/710400f712640e3e88b904d32a7bb8e508014c22 [^]

Related with issue 31317: The condition when the command is ADD is removed.

The "else if (request.getServletPath().toLowerCase().indexOf(SEND_PATH) != -1) {"
Condition should be removed for the correct behaviour of the attachments in the email sending.

---
M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
---
(0081646)
caristu   
2015-11-10 13:02   
Code review + tested OK:

- The error is not shown in the log.
- Both email and print dialogs are displayed correctly. The pop-up is not broken after attach a file to be sent by email.
- The print direct feature works fine.

(0082170)
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
(0082190)
hudsonbot   
2015-11-23 21:17   
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