Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023675Openbravo ERPA. Platformpublic2013-04-29 18:252013-04-30 21:05
marvintm 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
3.0MP23 
alostale
Core
No
0023675: OBContext seems to initially contain a wrong value for the Warehouse
It seems initially OBContext has a wrong value for the Warehouse. The warehouse contained in the OBContext should be the one displayed in the "User Info Widget". However, it seems it's a different one.
- In the "Product" selector, set the following default expression in the Warehouse field:

 if (OB.getContext().getWarehouse() != null) { OB.getContext().getWarehouse().id; }

- As System Admin, open the User window, open in edit mode the Openbravo record and delete the default client, organization and warehouse.

- Log in the application in the F&B client, with a Spanish warehouse.
- Go to the Sales Invoice window. Create a new sales invoice, and a new line for it.
- In the line, verify that no products are shown in the selector. Open the selector, and realize that a US warehouse is picked, even though we defined the default expression to get the warehouse from the OBContext.
- If now you reload the page via the User Info Widget (by clicking on "Apply", without changing anything), and repeat the previous steps, then the result will be correct.
No tags attached.
Issue History
2013-04-29 18:25marvintmNew Issue
2013-04-29 18:25marvintmAssigned To => AugustoMauch
2013-04-29 18:25marvintmModules => Core
2013-04-29 18:25marvintmTriggers an Emergency Pack => No
2013-04-30 09:19shankarbAssigned ToAugustoMauch => shankarb
2013-04-30 09:38shankarbAssigned Toshankarb => AugustoMauch
2013-04-30 10:57AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4636#r4636
2013-04-30 11:22AugustoMauchIssue Monitored: alostale
2013-04-30 11:22AugustoMauchReview Assigned To => alostale
2013-04-30 11:27hgbotCheckin
2013-04-30 11:27hgbotNote Added: 0058334
2013-04-30 11:27hgbotStatusnew => resolved
2013-04-30 11:27hgbotResolutionopen => fixed
2013-04-30 11:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a7efc1231554de4989245a9f006cecad40bd8ecb [^]
2013-04-30 11:45alostaleNote Added: 0058335
2013-04-30 11:45alostaleStatusresolved => closed
2013-04-30 11:45alostaleFixed in Version => 3.0MP23
2013-04-30 21:05hudsonbotCheckin
2013-04-30 21:05hudsonbotNote Added: 0058391

Notes
(0058334)
hgbot   
2013-04-30 11:27   
Repository: erp/devel/pi
Changeset: a7efc1231554de4989245a9f006cecad40bd8ecb
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Apr 30 11:27:05 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a7efc1231554de4989245a9f006cecad40bd8ecb [^]

Fixes issue 23675: OBContext initializes properly the user default warehouse

If the user did not have a default warehouse defined, OBContext was not initializing the warehouse properly. Instead of using the previosly obtained default organization to fetch the warehouse, it was using any organization in the user accessible tree. This way, the default warehouse could belong to a organization differente than the default organization.

To fix this, if a default organization is available, it will use it. If there is no default organization available or if there a no warehouses that belong to the default organization, the user accessible organization tree will be used.

---
M src/org/openbravo/base/secureApp/LoginUtils.java
---
(0058335)
alostale   
2013-04-30 11:45   
Code reviewed + verified on pi@a7efc1231554
(0058391)
hudsonbot   
2013-04-30 21:05   
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/3ea22ca7a348 [^]

Maturity status: Test