Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025899Openbravo ERPA. Platformpublic2014-03-04 17:132014-03-07 05:25
egoitz 
shankarb 
immediatemajorhave not tried
closedfixed 
5
 
3.0PR14Q23.0PR14Q2 
AugustoMauch
Core
No
0025899: When invoking the method Utility.getDocumentNo from a DalBaseProcess the client is not obtained
When invoking the method Utility.getDocumentNo from a DalBaseProcess the client is not obtained
-Create a new table (Prefix_Tablename) that includes all the mandatory columns and also name and documentno columns.
-Define it on application dictionary with name Prefix_Tablename
-Create a sequence with name DocumentNo_Prefix_Tablename. Do it with role different than system administrator.
-Create a new DalBaseProcess that creates a row on the new table using DAL
-fill only the name
-Define the DalBAseProcess as background process for client different than system
-When saving the documentno column should be filled automatically with the value of the sequence created.
*That does not work becuase the client is not obtained.
This happens because when trying to get the client the following method is used:
 String AD_Client_ID = getContext(con, vars, "AD_Client_ID", WindowNo);

ON getcontext method the client is obtained from a preference and if not fromthe httpsesson.
It is null for background processes.
Attached a posible solution
No tags attached.
diff client.diff (842) 2014-03-04 17:13
https://issues.openbravo.com/file_download.php?file_id=6730&type=bug
Issue History
2014-03-04 17:13egoitzNew Issue
2014-03-04 17:13egoitzAssigned To => AugustoMauch
2014-03-04 17:13egoitzFile Added: client.diff
2014-03-04 17:13egoitzModules => Core
2014-03-04 17:13egoitzResolution time => 1394406000
2014-03-04 17:13egoitzTriggers an Emergency Pack => No
2014-03-05 13:03alostaleTarget Version => PR14Q2
2014-03-05 13:36shankarbAssigned ToAugustoMauch => shankarb
2014-03-06 08:01shankarbStatusnew => scheduled
2014-03-06 08:01shankarbfix_in_branch => pi
2014-03-06 11:22shankarbReview Assigned To => AugustoMauch
2014-03-06 11:22shankarbfix_in_branchpi =>
2014-03-06 11:22shankarbIssue Monitored: AugustoMauch
2014-03-06 11:24hgbotCheckin
2014-03-06 11:25hgbotNote Added: 0064901
2014-03-06 11:25hgbotStatusscheduled => resolved
2014-03-06 11:25hgbotResolutionopen => fixed
2014-03-06 11:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7b3a543035a290bed343af1cfe290312caf04664 [^]
2014-03-06 12:09AugustoMauchNote Added: 0064908
2014-03-06 12:09AugustoMauchStatusresolved => closed
2014-03-06 12:09AugustoMauchFixed in Version => PR14Q2
2014-03-07 05:25hudsonbotCheckin
2014-03-07 05:25hudsonbotNote Added: 0064944

Notes
(0064901)
hgbot   
2014-03-06 11:25   
Repository: erp/devel/pi
Changeset: 7b3a543035a290bed343af1cfe290312caf04664
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Thu Mar 06 13:22:06 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/7b3a543035a290bed343af1cfe290312caf04664 [^]

Fixes Issue 0025899: In Utility.getDocumentNo the client is not obtained in some cases

When invoking the method Utility.getDocumentNo from a DalBaseProcess the client is not obtained.
In case client is not present in context, it is fetched from vars.

---
M src/org/openbravo/erpCommon/utility/Utility.java
---
(0064908)
AugustoMauch   
2014-03-06 12:09   
Code reviewed and verified in pi@7b3a543035a2
(0064944)
hudsonbot   
2014-03-07 05:25   
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/9364dd72aca6 [^]
Maturity status: Test