Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038218Openbravo ERP09. Financial managementpublic2018-03-26 13:252018-05-09 19:29
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q3 
aferraz
Core
No
0038218: 'Delete failed' error in Reset Accounting process if it is launched for 'Organization' type org without legal children
'Delete failed' error in Reset Accounting process if it is launched for 'Organization' type org without legal children

As group admin role:
   Launch Initial organization setup process
      Organization Type: Organization
      Parent organization: F&B España, S.A
      Set a Location
      Do not Include Accounting File

   Go to Organization window and Set As Ready
   Go to Reset Accounting window
      Client: F&B International Group
      Organization: the previously created one
      Delete existing Accounting Entries: Y
   Check the following error is shown:
      Delete failed
   The log shows:
ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: syntax error at or near ")" Position: 91
ERROR org.openbravo.common.actionhandler.ResetAccountingHandler - Error in Reset Accounting Action Handler
org.openbravo.base.exception.OBException: Delete failed
    at org.openbravo.financial.ResetAccounting.delete(ResetAccounting.java:210)
    at org.openbravo.financial.ResetAccounting.delete(ResetAccounting.java:58)
    at org.openbravo.common.actionhandler.ResetAccountingHandler.doExecute(ResetAccountingHandler.java:67)
No tags attached.
related to defect 00330633.0PR16Q3 closed markmm82 It should be possible to run "Reset Accounting" process for several organization at once 
related to defect 0037422 closed markmm82 Reset Accounting finishes with error if it is launched for an org with "Organization" type and the type name has been changed 
Issue History
2018-03-26 13:25ngarciaNew Issue
2018-03-26 13:25ngarciaAssigned To => Triage Finance
2018-03-26 13:25ngarciaModules => Core
2018-03-26 13:25ngarciaResolution time => 1523829600
2018-03-26 13:25ngarciaTriggers an Emergency Pack => No
2018-03-26 13:25ngarciaIssue Monitored: networkb
2018-03-26 13:26ngarciaRelationship addedrelated to 0033063
2018-03-27 15:37markmm82Assigned ToTriage Finance => markmm82
2018-03-27 15:37markmm82Statusnew => scheduled
2018-03-28 15:22markmm82Note Added: 0103615
2018-04-12 18:00hgbotCheckin
2018-04-12 18:00hgbotNote Added: 0103858
2018-04-12 18:00hgbotStatusscheduled => resolved
2018-04-12 18:00hgbotResolutionopen => fixed
2018-04-12 18:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1b60eec1321a769bdcd260ca184f511fe9b5ff20 [^]
2018-04-12 18:00aferrazReview Assigned To => aferraz
2018-04-12 18:00aferrazNote Added: 0103859
2018-04-12 18:00aferrazStatusresolved => closed
2018-04-12 18:00aferrazFixed in Version => 3.0PR18Q3
2018-04-12 18:01aferrazRelationship addedrelated to 0037422
2018-05-09 19:29hudsonbotCheckin
2018-05-09 19:29hudsonbotNote Added: 0104380

Notes
(0103615)
markmm82   
2018-03-28 15:22   
Test Plan:
As group admin role:
   Launch Initial organization setup process
      Organization Type: Organization
      Parent organization: F&B España, S.A
      Set a Location
      Do not Include Accounting File

   Go to Organization window and Set As Ready
   Go to Reset Accounting window
      Client: F&B International Group
      Organization: the previously created one
      Delete existing Accounting Entries: Y
   Notice the process ends successfully with 0 records affected
(0103858)
hgbot   
2018-04-12 18:00   
Repository: erp/devel/pi
Changeset: 1b60eec1321a769bdcd260ca184f511fe9b5ff20
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Mar 27 16:02:07 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/1b60eec1321a769bdcd260ca184f511fe9b5ff20 [^]

Fixes issue 38218: 'Delete failed' error in Reset Accounting process
if it is launched for 'Organization' type org without legal children

When the organization has an 'Organization' type and it doesn't has any legal
children, then a not well formed SQL sentence was throwing an exception because was trying
to filter orgs with the ad_org_id column in an empty list of IDs (ad_org_id in ()).

To fix that, if there isn't any organization to be affected by the process, then it is avoided
the execution of several steps of the algorithm, including don't execute queries
that uses the organization id list as filter.

So, if the organization has an 'Organization' type and it doesn't has any legal
children then the logic for the records deletion is skipped.

---
M src/org/openbravo/financial/ResetAccounting.java
---
(0103859)
aferraz   
2018-04-12 18:00   
Code review + Testing OK
(0104380)
hudsonbot   
2018-05-09 19:29   
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/2be7d3efe606 [^]
Maturity status: Test