Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038316Openbravo ERPA. Platformpublic2018-04-10 18:092018-05-09 19:30
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q3 
dmiguelez
Core
No
0038316: Warehouse in context (session) is different from the warehouse on the login in some circumstances, could affect tax selection
Warehouse in context (session) is different from the warehouse on the login in some circumstances, could affect tax selection
As group admin role:
   Create a new role
   Set is as not manual and as advanced
   Remove access from all the organizations except the following ones:
      F&B España - Región Norte
      F&B España, S.A.
      F&B US West Coast
   Create a new user
   Add the previously created role and set it as default role
   Deactivate España Región Norte warehouse
   Create a new warehouse and storage bin in F&B España, S.A.

Log in with the previously created user:
   Check the organization shown in the log is F&B España - Región Norte (max ad_org_id in ad_role_orgaccess table for the role)
   Check the warehouse shown is the newly created one

   Check the warehouse in session is US West coast (min m_warehouse_id in m_warehouse table, active and for this client)
   We could check it debugging SL_Invoice_Product callout
   Create a new purchase invoice for F&B España - Región Norte
   Add a product to it
   Check the value in the following line:

String strWarehouse = Utility
        .getContext(this, info.vars, "#M_Warehouse_ID", info.getWindowId());
   
   Open the user profile and apply without making any change

   Check the warehouse in session is the one in the login, the previously created one (you could use SL_Invoice_Product callout)
In LoginUtils.getDefaultWarehouse() function, in case there does not exist any warehouse defined for the specific organization (strOrg), select one warehouse from its natural tree
No tags attached.
Issue History
2018-04-10 18:09ngarciaNew Issue
2018-04-10 18:09ngarciaAssigned To => platform
2018-04-10 18:09ngarciaModules => Core
2018-04-10 18:09ngarciaResolution time => 1525212000
2018-04-10 18:09ngarciaTriggers an Emergency Pack => No
2018-04-10 18:13ngarciaIssue Monitored: networkb
2018-04-10 18:19ngarciaNote Added: 0103782
2018-04-13 13:10ngarciaAssigned Toplatform => Triage Finance
2018-04-13 13:14ngarciaProposed Solution updated
2018-04-13 13:23ngarciaSummaryWarehouse in context (session) is different from the warehouse on the login in some circumstances, could affect tax calculation => Warehouse in context (session) is different from the warehouse on the login in some circumstances, could affect tax selection
2018-04-13 13:23ngarciaDescription Updatedbug_revision_view_page.php?rev_id=16986#r16986
2018-04-13 13:25aferrazAssigned ToTriage Finance => collazoandy4
2018-04-30 15:13collazoandy4Statusnew => scheduled
2018-05-02 17:14collazoandy4Note Added: 0104209
2018-05-03 13:29hgbotCheckin
2018-05-03 13:29hgbotNote Added: 0104230
2018-05-03 13:29hgbotStatusscheduled => resolved
2018-05-03 13:29hgbotResolutionopen => fixed
2018-05-03 13:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/225d04f427667786a6ba5a1b5bbbde917ec0e1ef [^]
2018-05-03 13:30dmiguelezReview Assigned To => dmiguelez
2018-05-03 13:30dmiguelezNote Added: 0104231
2018-05-03 13:30dmiguelezStatusresolved => closed
2018-05-03 13:30dmiguelezFixed in Version => 3.0PR18Q3
2018-05-05 13:57shuehnerNote Added: 0104300
2018-05-05 13:57shuehnerStatusclosed => new
2018-05-05 13:57shuehnerResolutionfixed => open
2018-05-05 13:57shuehnerFixed in Version3.0PR18Q3 =>
2018-05-08 18:18hgbotCheckin
2018-05-08 18:18hgbotNote Added: 0104335
2018-05-08 18:19aferrazStatusnew => scheduled
2018-05-08 18:19aferrazStatusscheduled => resolved
2018-05-08 18:19aferrazFixed in Version => 3.0PR18Q3
2018-05-08 18:19aferrazResolutionopen => fixed
2018-05-08 18:20aferrazStatusresolved => closed
2018-05-09 19:29hudsonbotCheckin
2018-05-09 19:29hudsonbotNote Added: 0104427
2018-05-09 19:30hudsonbotCheckin
2018-05-09 19:30hudsonbotNote Added: 0104435

Notes
(0103782)
ngarcia   
2018-04-10 18:19   
If the warehouse in session belongs to the natural tree of the invoice's organization, it is used for tax calculation in invoices (that do not have warehouse defined)
(0104209)
collazoandy4   
2018-05-02 17:14   
Test Plan
  Go to Role window and create a new record:
    Name: IssueRole
    User Level: Client+Organization
    Manual: N
    Advanced: Y
    Remove access from all the organizations except the following ones:
      F&B España - Región Norte
      F&B España, S.A.
      F&B US West Coast
  Create a new user and asign the previous role created.
  Go to Warehouse and Storage Bins window and deactivated the Region Norte warehouse
    Create a new warehouse and storage bin in F&B España, S.A.

  Log in with the previously created user:
   Check the organization shown in the log is F&B España - Región Norte
   Check the warehouse shown is the newly created one

   Check the warehouse in session is newly created one
   We could check it debugging SL_Invoice_Product callout
   Create a new purchase invoice for F&B España - Región Norte
   Add a product to it
   Check the value in the following line:
     String strWarehouse = Utility.getContext(this, info.vars, "#M_Warehouse_ID", info.getWindowId());
   Open the user profile and apply without making any change
   Check the warehouse in session is the one in the login, the previously created one (use SL_Invoice_Product callout)
(0104230)
hgbot   
2018-05-03 13:29   
Repository: erp/devel/pi
Changeset: 225d04f427667786a6ba5a1b5bbbde917ec0e1ef
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon Apr 30 08:23:08 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/225d04f427667786a6ba5a1b5bbbde917ec0e1ef [^]

Fixes issue 38316:Warehouse in context (session) is different from the warehouse
on the login in some circumstances, could affect tax selection

Under some circumstances the warehouse in the session is different from the warehouse
on the login that could affect tax selection

Now in case there does not exist any warehouse defined for the specific organization
one is selected from the organization natural tree

---
M src/org/openbravo/base/secureApp/LoginUtils.java
---
(0104231)
dmiguelez   
2018-05-03 13:30   
Code Review + Testing Ok
(0104300)
shuehner   
2018-05-05 13:57   
That change is creating unused code which instead should be deleted.

Specifically the removal of OrgTreeData.select call when checked was the only user of that non-public xsql file (OrgTree_data.xsql)
After removal that call that while xsql file is not used at all. As it is not part of public api it can just be removed easily. -> hg remove the whole xsql file please.
(0104335)
hgbot   
2018-05-08 18:18   
Repository: erp/devel/pi
Changeset: 3952682173bf571a7fb290e905975bb4cc6333dd
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon May 07 11:27:06 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/3952682173bf571a7fb290e905975bb4cc6333dd [^]

Related to issue 38316: Removed unused xsql file.

The OrgTree_data xsql file is not used at all after the OrgTreeData.select removal

---
R src/org/openbravo/base/secureApp/OrgTree_data.xsql
---
(0104427)
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
(0104435)
hudsonbot   
2018-05-09 19:30   
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