Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020311Openbravo ERP03. Procurement managementpublic2012-04-19 11:322012-04-26 12:23
VictorVillar 
alostale 
immediatemajoralways
closedfixed 
5
3.0MP10.1 
3.0MP113.0MP11 
Core
No
0020311: Null pointer exception error when the user tries to send an email of one voided invoice
When the users tries to send an email of one voided invoice (sales or purchase), they received an error.
As group admin role,
Go to Client window
 Go to Email configuration tab:
    Configure it
Go to Sales invoice or Purchase Invoice window
Send an email of one completed invoice, correct
Void one invoice, try to send it by email. An error appear (see screenshot)

If you check the log (attached) it is a null pointer exception error.
No tags attached.
png erroremail.png (199,079) 2012-04-19 11:32
https://issues.openbravo.com/file_download.php?file_id=5150&type=bug
png

txt emailerrorlog.txt (3,819) 2012-04-19 11:33
https://issues.openbravo.com/file_download.php?file_id=5151&type=bug
Issue History
2012-04-19 11:32VictorVillarNew Issue
2012-04-19 11:32VictorVillarAssigned To => vmromanos
2012-04-19 11:32VictorVillarFile Added: erroremail.png
2012-04-19 11:32VictorVillarModules => Core
2012-04-19 11:32VictorVillarResolution time => 1337724000
2012-04-19 11:33VictorVillarFile Added: emailerrorlog.txt
2012-04-19 11:33VictorVillarIssue Monitored: networkb
2012-04-19 13:34jonalegriaesarteTag Attached: Regression
2012-04-19 13:35jonalegriaesarteAssigned Tovmromanos => alostale
2012-04-19 13:45jonalegriaesartePriorityurgent => immediate
2012-04-19 15:17alostaleAssigned Toalostale => guilleaer
2012-04-19 15:28shuehnerIssue Monitored: shuehner
2012-04-20 08:53alostaleTag Detached: Regression
2012-04-20 09:05alostaleNote Added: 0047769
2012-04-20 09:10alostaleAssigned Toguilleaer => alostale
2012-04-20 09:11hgbotCheckin
2012-04-20 09:11hgbotNote Added: 0047770
2012-04-20 09:11hgbotStatusnew => resolved
2012-04-20 09:11hgbotResolutionopen => fixed
2012-04-20 09:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4cda1ec9b931cd2d443266973afde1c824401037 [^]
2012-04-21 14:24hudsonbotCheckin
2012-04-21 14:24hudsonbotNote Added: 0047850
2012-04-26 12:23AugustoMauchNote Added: 0048009
2012-04-26 12:23AugustoMauchStatusresolved => closed
2012-04-26 12:23AugustoMauchFixed in Version => 3.0MP11

Notes
(0047769)
alostale   
2012-04-20 09:05   
This issue is not a regression (verified in 3.0MP7.3).

The actual problem is can happen in these two situations:
1. When trying to print at the same time more than one record having them different document types. In this situation in consistently raises NPE.
2. Printing a document and later printing another document with a different document type. This occurs randomly because different selected document types variable is not properly initialized/reused (see issue 0020319). This case is a variant of 1st one and it is the described case. Note this is the described situation, perceived as regression because of its random nature.

Steps to reproduce/test plan:
* Go go Sales Invoice window. In grid mode show Transaction Document column.
* To reproduce case 1:
  -Select 2 completed records with different Transaction Document.
  -Click on email button -> NPE
* To reproduce case 2 (and reported issue):
  -Create a new Sales Invoice with AR Invoice document type.
  -Add lines and complete
  -Email it. OK
  -Void this document. Note there is a new record with Reversed Sales Invoice document type
  -Print this new record -> Randomly NPE can happen

The provided fix is not risky. It doesn't solve thread safety (to be solved by 0020319) but multi document type email.
(0047770)
hgbot   
2012-04-20 09:11   
Repository: erp/devel/pi
Changeset: 4cda1ec9b931cd2d443266973afde1c824401037
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Apr 20 09:11:01 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4cda1ec9b931cd2d443266973afde1c824401037 [^]

fixed bug 20311: NPE when printing multiple documents

  Hidden tags in this case was inccorectly set.

---
M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
---
(0047850)
hudsonbot   
2012-04-21 14:24   
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/2eb57286c1fc [^]

Maturity status: Test
(0048009)
AugustoMauch   
2012-04-26 12:23   
Code reviewed and verified in pi@52d3acc5d1d4