Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0051490Openbravo ERPA. Platformpublic2023-01-29 00:132023-01-29 00:13
jlopez 
Triage Platform Base 
normalminoralways
newopen 
5
 
 
Core
No
0051490: Error while adding the tree node: Entity ADTree may only have instances with organization *
When a module containing a table defined as a tree is first installed (for example, Commercial Operations), the node tree (ADTree) does not exist. If an attempt is made to create a record in that table with a user whose context organization is other than *, it displays the following error:

Error
Saving failed. Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update AD_Tree set AD_Client_ID=?, AD_Org_ID=?, Created=?, CreatedBy=?, Updated=?, UpdatedBy=?, IsActive=?, Name=?, Description=?, TreeType=?, IsAllNodes=?, AD_Table_ID=? where AD_Tree_ID=?

The error occurs because when trying to build the tree, it can only be instantiated with organization * and the organization you are trying to use is the one in the user context:

ERROR org.openbravo.service.datasource.ADTreeDatasourceService - Error while adding the tree node
org.openbravo.base.exception.OBSecurityException: Entity ADTree may only have instances with organization *
1.- Login in Retail POS2 Modules backoffice in Live Builds
2.- Make sure the organization of the context is different from *
3.- Go to the Commercial Operations window
4.- Create a new record successfully and try to save it
5.- The error will be displayed
Modify the "createTree" function in org.openbravo.service.datasource.ADTreeDatasourceService so that it generates the tree with organization * by default.
No tags attached.
png screenshot 2023-01-29 00-06-19.png (76,156) 2023-01-29 00:13
https://issues.openbravo.com/file_download.php?file_id=18075&type=bug
png
Issue History
2023-01-29 00:13jlopezNew Issue
2023-01-29 00:13jlopezAssigned To => Triage Platform Base
2023-01-29 00:13jlopezFile Added: screenshot 2023-01-29 00-06-19.png
2023-01-29 00:13jlopezModules => Core
2023-01-29 00:13jlopezTriggers an Emergency Pack => No

There are no notes attached to this issue.