Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0017132Openbravo ERP09. Financial managementpublic2011-05-12 09:562011-05-26 07:44
RenateNieuwkoop 
eduardo_Argal 
normalminorhave not tried
closedfixed 
5
3.0RC6.1 
3.0RC73.0RC7 
Core
No
0017132: 3.0RC6.1: Post of withholding errors
In the BFT there is an exercise for withholding that has been functioning fine sofar. However, now in 6.1 I get an error with the posting. See screenshots.
Using the F&B International Group Admin role:
Go to the Account Tree screen
Select the F&B US, Inc. Account
Go to the [Element Value] tab
Create a new record
Organization = F&B US, Inc.,
Search Key = 2255,
Name = Tax Receivables Withholding,
Summary Level checkbox = not selected,
Element Level = Subaccount,
Account Type = Liability,
Account Sign = Debit,
Save the record
Click on tree icon at the top of the screen
Position the 2255 in the tree, in the liabilities folder above the 2260 account:
Click the Close button
Go to the Tax Category screen
Create a new record
Organization = F&B US, Inc.,
Name = US Withholding,
Default checkbox = not selected,
Save the record.
Go to the Business Partner Tax Category screen
Create a new record
Organization = F&B US, Inc.,
Name = US Withholding BP,
save the record
Go to the Tax Rate screen
Create a new record
Organization = F&B US, Inc.,
Name = US Withholding Tax Rate 15%,
Default checkbox = not selected,
Valid from Date = today's date,
Cascade checkbox = not selected,
Tax Category = US Withholding,
Summary Level checkbox = not selected,
Parent Tax Rate = blank,
Rate = 15.00,
Sales/Purchase Type = Purchase Tax,
Base Amount = Line Net Amount,
Document Tax Amount Calculation = Document based amount by rate,
Withholding tax checkbox = selected,
Tax Search Key = blank,
Business Partner Tax Category = US Withholding BP,
Not taxable checkbox = not selected,
Country = United States,
Destination Country = blank,
Tax not deductible checkbox = not selected,
Tax deductible checkbox = not selected,
Region = FL,
Deductable Rate = blank,
Destination region = blank,
Save the record
Go to the [Accounting] tab to select the tax related to withholding:
Select F&B US Inc., US/A/US Dollar,
Click the selector of the Tax Credit field
Organization = F&B US, Inc.
Account = 2255
Click the Save button
Click the OK button
The new created F&B US, Inc.-2255-- account appears in the Tax Credit field
Click the save record
Enter the vendor:
Go to the Business Partner screen
Create a new record
Organization = F&B US, Inc.,
Search Key = FFJuices
Name = Fruity Fruit Juices, Inc.,
Business Partner Category = Supplier,
Save the record
Go to the [Customer] tab
Unselect the Customer checkbox
Go to the [Vendor/Creditor] tab
Create a new record
Select the Vendor checkbox
Purchase Pricelist = General Purchases (as created in exercise AM1 in Asset Management)
PO Payment Method = Wire Transfer,
PO Payment Terms = 30 days,
PO Financial Account = US Bank - Account 1,
Tax Category = US Withholding BP,
Save the record
Go to the [Location/Address] tab
Create a new record
Location/Address, click the selector:
1st line = Fruit Tree Lane 12,
City = Miami,
Country = United States,
Region = FL,
Click the OK button,
Save the record

Using the F&B US, Inc - Finance & HR role:
Go to the Purchase Invoice screen
Create a new record
Organization = F&B US East Coast,
Transaction Document = US AP Invoice,
Business Partner = Fruity Fruit Juices, Inc.
Invoice Date = today's date,
Accounting Date = today's date,
Price List = General Purchases,
Currency = USD,
Payment Method = Wire Transfer,
Payment Terms = 30 days,
Save the record
Go to the [Lines] tab
Create a new record
Organization = F&B US East Coast,
Product = Lager Beer (by clicking the product selector and removing all filters),
Invoice Quantity = 100,
Tax = US Withholding Tax Rate 15%,
Save the record
Go to the main tab and complete the document:
Click the Complete button
Click the OK button

After this, the post button is showing an error
openbravo@por0831:~/workspaces/develOracle/pi/openbravo$ hg diff
diff --git a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java
@@ -656,6 +656,8 @@
     m_fact = new Fact[m_as.length];
     // AcctSchema Table check
     boolean isTableActive = false;
+ try {
+ OBContext.setAdminMode(true);
     for (AcctSchema as : m_as) {
       AcctSchemaTable table = null;
       OBCriteria<AcctSchemaTable> criteria = OBDao.getFilteredCriteria(AcctSchemaTable.class,
@@ -669,6 +671,9 @@
         break;
       }
     }
+ } finally {
+ OBContext.restorePreviousMode();
+ }
     if (!isTableActive) {
       setMessageResult(conn, vars, STATUS_TableDisabled, "Warning");
       return false;
No tags attached.
png 11052011PosterrorWithh1.png (93,096) 2011-05-12 09:56
https://issues.openbravo.com/file_download.php?file_id=3981&type=bug
png
Issue History
2011-05-12 09:56RenateNieuwkoopNew Issue
2011-05-12 09:56RenateNieuwkoopAssigned To => eduardo_Argal
2011-05-12 09:56RenateNieuwkoopFile Added: 11052011PosterrorWithh1.png
2011-05-12 09:56RenateNieuwkoopModules => Core
2011-05-17 14:18dalsasuaNote Added: 0037074
2011-05-17 14:20dalsasuaNote Added: 0037075
2011-05-17 14:20dalsasuaProposed Solution updated
2011-05-17 14:55RenateNieuwkoopNote Added: 0037077
2011-05-18 10:37dmitry_mezentsevTarget Version => 3.0RC7
2011-05-18 11:25hgbotCheckin
2011-05-18 11:25hgbotNote Added: 0037125
2011-05-18 11:25hgbotStatusnew => resolved
2011-05-18 11:25hgbotResolutionopen => fixed
2011-05-18 11:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/444c11bbdbff69748ba8295039c572ed2f8a777f [^]
2011-05-19 09:44psarobeNote Added: 0037190
2011-05-19 09:44psarobeStatusresolved => closed
2011-05-19 09:44psarobeFixed in Version => 3.0RC7
2011-05-26 07:44hudsonbotCheckin
2011-05-26 07:44hudsonbotNote Added: 0037485

Notes
(0037074)
dalsasua   
2011-05-17 14:18   
I'm not able to obtain the reported exception. On the other hand, I obtain a NullPointerException. This is the stacktrace:
10359215 [TP-Processor12] ERROR org.openbravo.base.exception.OBSecurityException - Entity FinancialMgmtAcctSchemaTable is not readable by the user 100
org.openbravo.base.exception.OBSecurityException: Entity FinancialMgmtAcctSchemaTable is not readable by the user 100
    at org.openbravo.dal.security.EntityAccessChecker.checkReadable(EntityAccessChecker.java:347)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:501)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:488)
    at org.openbravo.dal.service.OBDal.createCriteria(OBDal.java:365)
    at org.openbravo.dal.service.OBDao.getFilteredCriteria(OBDao.java:48)
    at org.openbravo.erpCommon.ad_forms.AcctServer.post(AcctServer.java:663)
    at org.openbravo.erpCommon.ad_forms.AcctServer.post(AcctServer.java:612)
    at org.openbravo.erpCommon.ad_actionButton.Posted.processButton(Posted.java:152)
    at org.openbravo.erpCommon.ad_actionButton.Posted.doPost(Posted.java:86)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:456)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:619)
10359221 [TP-Processor12] WARN org.openbravo.erpCommon.ad_forms.AcctServer - org.openbravo.base.exception.OBSecurityException: Entity FinancialMgmtAcctSchemaTable is not readable by the user 100
org.openbravo.base.exception.OBSecurityException: Entity FinancialMgmtAcctSchemaTable is not readable by the user 100
    at org.openbravo.dal.security.EntityAccessChecker.checkReadable(EntityAccessChecker.java:347)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:501)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:488)
    at org.openbravo.dal.service.OBDal.createCriteria(OBDal.java:365)
    at org.openbravo.dal.service.OBDao.getFilteredCriteria(OBDao.java:48)
    at org.openbravo.erpCommon.ad_forms.AcctServer.post(AcctServer.java:663)
    at org.openbravo.erpCommon.ad_forms.AcctServer.post(AcctServer.java:612)
    at org.openbravo.erpCommon.ad_actionButton.Posted.processButton(Posted.java:152)
    at org.openbravo.erpCommon.ad_actionButton.Posted.doPost(Posted.java:86)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:456)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:619)
10359225 [TP-Processor12] ERROR org.openbravo.erpCommon.ad_actionButton.Posted - Error captured:
java.lang.NullPointerException
    at org.openbravo.erpCommon.ad_actionButton.Posted.doPost(Posted.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:456)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:619)
(0037075)
dalsasua   
2011-05-17 14:20   
It seems the user is not able to access the Table table in "Restrictions.eq("table.id", AD_Table_ID)", and that's why it fails. Proposed solution is to set admin mode before executing the query. Assigning to Eduardo, as seems to be a topic he has already covered with the platform team recently.
(0037077)
RenateNieuwkoop   
2011-05-17 14:55   
I executed it with the Finance and HR Role, which is the logical role to use. Can permission be added to the Finance and HR Role for this? It will be odd to have students change to the Admin role just to execute the posting, it should be possible with the Finance and HR role.
(0037125)
hgbot   
2011-05-18 11:25   
Repository: erp/devel/pi
Changeset: 444c11bbdbff69748ba8295039c572ed2f8a777f
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Wed May 18 10:55:22 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/444c11bbdbff69748ba8295039c572ed2f8a777f [^]

Fixes issue 17132: Posting with non-admin roles failed

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
---
(0037190)
psarobe   
2011-05-19 09:44   
Done TA1 successfully
(0037485)
hudsonbot   
2011-05-26 07:44   
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/728387046be6 [^]

Maturity status: Test