Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037422Openbravo ERP09. Financial managementpublic2017-11-30 10:272018-05-09 19:29
ngarcia 
markmm82 
highminoralways
closedfixed 
5
 
3.0PR18Q3 
aferraz
Core
No
0037422: Reset Accounting finishes with error if it is launched for an org with "Organization" type and the type name has been changed
Reset Accounting finishes with error if it is launched for an org with "Organization" type and the type name has been changed. Delete accounting entries option should be selected.

The problem is in the following piece of code of ResetAccounting.delete function:

Set<String> orgIds = StringUtils.equals(org.getOrganizationType().getName(), "Organization") ? getLegalOrBusinessOrgsChilds(client, adOrgId) : new OrganizationStructureProvider().getChildTree(adOrgId, true);
As system admin role:
   Go to Organization Type window and change the name of "Organization" record

As group admin role:
   Launch the Reset Accounting process:
      Client: F&B International Group
      Organization: *
      Delete accounting entries: Y
   Check the following error is shown:
      Delete failed

   The log shows:
      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)...
Caused by: java.lang.NullPointerException
    at org.openbravo.financial.ResetAccounting.delete(ResetAccounting.java:148)
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 0038218 closed markmm82 'Delete failed' error in Reset Accounting process if it is launched for 'Organization' type org without legal children 
Issue History
2017-11-30 10:27ngarciaNew Issue
2017-11-30 10:27ngarciaAssigned To => Triage Finance
2017-11-30 10:27ngarciaModules => Core
2017-11-30 10:27ngarciaTriggers an Emergency Pack => No
2017-11-30 10:27ngarciaIssue Monitored: networkb
2017-11-30 10:28ngarciaDescription Updatedbug_revision_view_page.php?rev_id=16407#r16407
2017-11-30 11:20ngarciaRelationship addedrelated to 0033063
2017-12-07 17:31markmm82Assigned ToTriage Finance => markmm82
2017-12-07 17:32markmm82Statusnew => scheduled
2017-12-11 16:50markmm82Note Added: 0100969
2018-04-12 18:01aferrazRelationship addedrelated to 0038218
2018-04-12 18:14hgbotCheckin
2018-04-12 18:14hgbotNote Added: 0103860
2018-04-12 18:14hgbotStatusscheduled => resolved
2018-04-12 18:14hgbotResolutionopen => fixed
2018-04-12 18:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/eac492d3b3d20f3b684cf5026393dfb138eb69da [^]
2018-04-12 18:16aferrazReview Assigned To => aferraz
2018-04-12 18:16aferrazNote Added: 0103861
2018-04-12 18:16aferrazStatusresolved => closed
2018-04-12 18:16aferrazFixed in Version => 3.0PR18Q3
2018-05-09 19:29hudsonbotCheckin
2018-05-09 19:29hudsonbotNote Added: 0104381

Notes
(0100969)
markmm82   
2017-12-11 16:50   
As system admin role:
   Go to Organization Type window and change the name of "Organization" record

As group admin role:
   Launch the Reset Accounting process:
      Client: F&B International Group
      Organization: *
      Delete accounting entries: Y
   Check the process ends successfully with information of the affected records. For instance:
"Number of unposted documents = 3325, Number of deleted journal entries = 16715"
(0103860)
hgbot   
2018-04-12 18:14   
Repository: erp/devel/pi
Changeset: eac492d3b3d20f3b684cf5026393dfb138eb69da
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Dec 11 10:45:43 2017 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/eac492d3b3d20f3b684cf5026393dfb138eb69da [^]

Fixes issue 37422: Reset Accounting finishes with error if it is launched
for an org with "Organization" type and the type name has been changed

As the process was expecting "Organization" as the organization type's name and it
can be changed, the process failed if the name is changed.

To avoid it, comparison is made with the organization type ID instead of the organization
type name, as the ID should not be changed.

---
M src-db/database/sourcedata/OBUISEL_SELECTOR.xml
M src/org/openbravo/financial/ResetAccounting.java
---
(0103861)
aferraz   
2018-04-12 18:16   
Code review + Testing OK
(0104381)
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