Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046178Openbravo ERPI. Performancepublic2021-03-30 07:312021-04-06 14:26
jetxarri 
markmm82 
highmajoralways
closedfixed 
5
PR20Q3.4 
PR21Q3 
Core
No
0046178: Avoid trying to find the general ledger configuration if it is not configured in any organization
When the ERP is being used with Web POS the accounting of the system is not configured, however in each login the system tries to find general ledger configuration to set in the session
Do a login
Attached file
NOR
related to defect 0046177 feedback jetxarri Avoid ordering preferences by id because it only adds time to the statement execution 
related to defect 0046217 new platform Organization entity and OBCriteria.setFilterOnReadableOrganization(true) won't work 
blocks defect 0046176 feedback jetxarri Create an index in ad_preference table to execute read statements faster 
diff patch.diff (3,881) 2021-03-30 07:31
https://issues.openbravo.com/file_download.php?file_id=15480&type=bug
Issue History
2021-03-30 07:31jetxarriNew Issue
2021-03-30 07:31jetxarriAssigned To => platform
2021-03-30 07:31jetxarriFile Added: patch.diff
2021-03-30 07:31jetxarriModules => Core
2021-03-30 07:31jetxarriTriggers an Emergency Pack => No
2021-03-30 17:31rafarodaTag Attached: NOR
2021-03-30 17:33rafarodaRelationship addedrelated to 0046177
2021-03-30 17:33rafarodaRelationship addedblocks 0046176
2021-03-31 10:35alostaleAssigned Toplatform => Triage Finance
2021-03-31 12:39rafarodaSeverityminor => major
2021-04-01 09:09vmromanosAssigned ToTriage Finance => markmm82
2021-04-01 18:30markmm82Statusnew => scheduled
2021-04-05 20:03hgbotNote Added: 0127091
2021-04-06 14:24vmromanosRelationship addedrelated to 0046217
2021-04-06 14:26hgbotNote Added: 0127109
2021-04-06 14:26hgbotResolutionopen => fixed
2021-04-06 14:26hgbotStatusscheduled => closed
2021-04-06 14:26hgbotFixed in Version => PR21Q3
2021-04-06 14:26hgbotNote Added: 0127110
2021-04-06 14:26hgbotNote Added: 0127111

Notes
(0127091)
hgbot   
2021-04-05 20:03   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/342 [^]
(0127109)
hgbot   
2021-04-06 14:26   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/342 [^]
(0127110)
hgbot   
2021-04-06 14:26   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 3694254d523396db9f7baee17b34c1abfc25165a
Author: Mark <markmm82@gmail.com>
Date: 2021-04-06T12:20:10+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/3694254d523396db9f7baee17b34c1abfc25165a [^]

Fixes ISSUE-46178: Ask if exists an org with GL configured instead of iterate all the existing ones
when filling session

Before trying to iterate throught all the organizations checking general ledger configuration, verify that
any of them has the configuration

---
M src/org/openbravo/base/secureApp/LoginUtils.java
---
(0127111)
hgbot   
2021-04-06 14:26   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 674e5f969d4d69e340613312e24fcabab1c79a7e
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-04-06T12:20:10+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/674e5f969d4d69e340613312e24fcabab1c79a7e [^]

Related to ISSUE-46178: Code review improvements

Removed setFilterOnReadableOrganization(false) because it has no sense. Note that
just after this, the flow gets the list of editable organizations using:
  Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
and it iterates over them (and their parent tree) to get the ledger configuration.

The ledger configuration must be in a readable organization (either in an editable
organization or in a parent editable/readable organization), so the filter by
readable organization should be in.

Note that ideally we should filter by the editable organizations and their parents,
which is what later on is going to be used, however the purpose of this fix is to
avoid performance penalty, so having a fast (although inaccurate query in some corner
cases) is a good approach.

Apart from that the method has been renamed to be more clear.

---
M src/org/openbravo/base/secureApp/LoginUtils.java
---