Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030811Openbravo ERP03. Procurement managementpublic2015-09-10 16:562015-09-15 15:56
malsasua 
dmiguelez 
immediatemajoralways
closedfixed 
20Community Appliance
pi 
 
vmromanos
Core
Production - QA Approved
2015-04-28
3.0PR15Q3
https://code.openbravo.com/erp/devel/pi/annotate/b134bab019fe/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java#l123 [^]
No
0030811: process: "Create expense AP Invoice" does not work
the process to create the purchase invoice from expense sheet is not working. Error is returned:
    
Error
java.lang.NullPointerException
. in F&B
 . create a new product (p1) of type Expense and add in Price list Otros servicios
 . configure the BP: Javier Martin:
    . Vendor: true
       PO price list: otros servicios
       PO payment method: anyone
       PO payment termns: anyone
       PO financial account: anyone

 . go to expense sheet:
  new record:
   BP: Javier Martin
   date: 10-08-2015
   new line
     time sheet: no
     product: p1
     net unit price: 10
     date: 10-08-2015
  .process it

. go to "Create expense ap invoice" process
 . bp: javier martin
 . date from: 01-08-2015
 . date to: 31-08-2015
 . date invoice: 31-08-2015

process -> error is returned
java.lang.NullPointerException
. the problem is in the line
https://code.openbravo.com/erp/devel/pi/file/13211c4cc0a0/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java#l200 [^]
the insert of invoice header is done with the connection "conn" (and this connection is of type DalConnectionProvider(false).getTransactionConnection()) but after that, in the line
https://code.openbravo.com/erp/devel/pi/file/13211c4cc0a0/src/org/openbravo/erpCommon/utility/AccDefUtility.java#l135 [^]
this invoice is not retrieved, because it is in other session.

I think that the commit that it generated the regression is:
https://code.openbravo.com/erp/devel/pi/annotate/b134bab019fe/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java#l123 [^]
No tags attached.
depends on backport 00308183.0PR15Q3.2 closed dmiguelez Openbravo ERP process: "Create expense AP Invoice" does not work 
caused by defect 0028934 closed inigosanchez Modules Error when launching "Create AP Expense Invoices" related to Openbravo External Connection Pools module. 
has duplicate defect 0030314 closed Triage Omni OMS Openbravo ERP NullPointerException when launching the Create AP Expense Invoices process 
related to defect 0036945 closed AtulOpenbravo Modules Cannot post a document from the Report Not Posted window if an External Connection Pool is not used 
diff patch.diff (1,532) 2015-09-14 10:25
https://issues.openbravo.com/file_download.php?file_id=8444&type=bug
Issue History
2015-09-10 16:56malsasuaNew Issue
2015-09-10 16:56malsasuaAssigned To => Triage Finance
2015-09-10 16:56malsasuaModules => Core
2015-09-10 16:56malsasuaRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/annotate/b134bab019fe/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java#l123 [^]
2015-09-10 16:56malsasuaTriggers an Emergency Pack => No
2015-09-14 10:20dmiguelezStatusnew => scheduled
2015-09-14 10:20dmiguelezAssigned ToTriage Finance => dmiguelez
2015-09-14 10:23dmiguelezNote Added: 0080364
2015-09-14 10:25dmiguelezFile Added: patch.diff
2015-09-14 13:54malsasuaResolution time => 1442354400
2015-09-14 15:59vmromanosRelationship addedcaused by 0028934
2015-09-14 15:59vmromanosStatusscheduled => acknowledged
2015-09-14 16:02vmromanosReview Assigned To => vmromanos
2015-09-14 16:02vmromanosRegression level => Production - QA Approved
2015-09-14 16:02vmromanosRegression date => 2015-04-28
2015-09-14 16:02vmromanosRegression introduced in release => 3.0PR15Q3
2015-09-14 16:06vmromanosStatusacknowledged => scheduled
2015-09-14 17:55hgbotCheckin
2015-09-14 17:55hgbotNote Added: 0080383
2015-09-14 17:55hgbotStatusscheduled => resolved
2015-09-14 17:55hgbotResolutionopen => fixed
2015-09-14 17:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/63bf09cfd4a8f2ee5c9668f671a10494d3e99f55 [^]
2015-09-14 17:55vmromanosNote Added: 0080384
2015-09-14 17:55vmromanosStatusresolved => closed
2015-09-15 15:56hudsonbotCheckin
2015-09-15 15:56hudsonbotNote Added: 0080405
2015-10-05 19:11ngarciaRelationship addedhas duplicate 0030314
2017-09-26 10:39aferrazRelationship addedrelated to 0036945

Notes
(0080364)
dmiguelez   
2015-09-14 10:23   
. in F&B
 . create a new product (p1) of type Expense and add in Price list Otros servicios
 . configure the BP: Javier Martin:
    . Vendor: true
       PO price list: otros servicios
       PO payment method: anyone
       PO payment termns: anyone
       PO financial account: anyone

 . go to expense sheet:
  new record:
   BP: Javier Martin
   date: 10-08-2015
   new line
     time sheet: no
     product: p1
     net unit price: 10
     date: 10-08-2015
  .process it

. go to "Create expense ap invoice" process
 . bp: javier martin
 . date from: 01-08-2015
 . date to: 31-08-2015
 . date invoice: 31-08-2015

process -> Process Completed sucessfully

Apply attached patch.
Run the test again.
Realize that it fails with a proper error message, not with a Null Pointer Exception.
(0080383)
hgbot   
2015-09-14 17:55   
Repository: erp/devel/pi
Changeset: 63bf09cfd4a8f2ee5c9668f671a10494d3e99f55
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Sep 14 10:24:52 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/63bf09cfd4a8f2ee5c9668f671a10494d3e99f55 [^]

Fixes Issue 30811: Changes connection used for retrieving data using
xsql files. Uses OBDal Connection and uses OBDal methods for
doing rollback and commit with Close.

---
M src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java
---
(0080384)
vmromanos   
2015-09-14 17:55   
Code review + testing OK
(0080405)
hudsonbot   
2015-09-15 15:56   
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/27462487da9b [^]
Maturity status: Test