Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020191Openbravo ERPA. Platformpublic2012-04-03 08:562012-04-27 15:10
VictorVillar 
alostale 
highminoralways
closedfixed 
5
3.0MP9 
3.0MP12pi 
Core
No
0020191: OBContext.getLanguage does only use users' default language, in java process
We expect that when we put Spanish in the "Role PopUp"
language combo no matter my User default language, everything shoud be in spanish,however we see error messages based on our User default language. we have debugged and the reason is that OBContext.getLanguage give us the User default language. This errors come from a java process (process bundle created in a module).
the OBContext code for getLanguage does only read the language from the users default language setting.

The errors come from a java process (process bundle created in a module).
No tags attached.
related to defect 0013136 closed mtaal OBContext.getLanguage does only use users' default language, and does not honor language change in the role change popup 
has duplicate defect 0018214 closed alostale Scheduled processes executed on tomcat restart 
? org.openbravo.issue18214-0.0.0.obx (3,017) 2012-04-10 17:51
https://issues.openbravo.com/file_download.php?file_id=5125&type=bug
Issue History
2012-04-03 08:56VictorVillarNew Issue
2012-04-03 08:56VictorVillarAssigned To => alostale
2012-04-03 08:56VictorVillarModules => Core
2012-04-03 08:56VictorVillarResolution time => 1339452000
2012-04-03 08:56VictorVillarIssue Monitored: networkb
2012-04-03 08:57VictorVillarRelationship addedrelated to 0013136
2012-04-04 11:56alostaleNote Added: 0047379
2012-04-04 11:56alostaleStatusnew => feedback
2012-04-04 13:15rafademiguelNote Added: 0047389
2012-04-04 13:27VictorVillarNote Added: 0047391
2012-04-04 13:27VictorVillarStatusfeedback => new
2012-04-10 17:51alostaleRelationship addedhas duplicate 0018214
2012-04-10 17:51alostaleFile Added: org.openbravo.issue18214-0.0.0.obx
2012-04-10 18:03alostaleNote Added: 0047441
2012-04-10 18:04alostaleNote Added: 0047442
2012-04-10 18:15hgbotCheckin
2012-04-10 18:15hgbotNote Added: 0047443
2012-04-10 18:15hgbotStatusnew => resolved
2012-04-10 18:15hgbotResolutionopen => fixed
2012-04-10 18:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9547870c49c8555e62399b3c1d18ecd523c6a5a9 [^]
2012-04-17 05:31hudsonbotCheckin
2012-04-17 05:31hudsonbotNote Added: 0047623
2012-04-27 15:10guilleaerNote Added: 0048153
2012-04-27 15:10guilleaerStatusresolved => closed
2012-04-27 15:10guilleaerFixed in Version => pi

Notes
(0047379)
alostale   
2012-04-04 11:56   
Please provide more information about this issue
(0047389)
rafademiguel   
2012-04-04 13:15   
More Info:

It happens in:

public class FixQuantities extends DalBaseProcess

doing FIN_Utility.messageBD("OBAPFQ_FixQuantityChanged")

FIN_Utility.messageBD is OB Code in MP8.1:

https://code.openbravo.com/erp/devel/main/file/482fdc3919a1/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java#l607 [^]

You can access to code and module in the forge:

http://forge.openbravo.com/projects/agilefixquantities/code/hg/agilefixquantities/file/fdba12d4d806/src/com/openbravo/gps/agileproduction/fixquantities/process/FixQuantities.java#l1 [^]
(0047391)
VictorVillar   
2012-04-04 13:27   
Rafa's news. He gives more information
(0047441)
alostale   
2012-04-10 18:03   
This issue affects in 2 different situations:

1. UI generated processes extending DalBaseProcess and executed from button (as reported) or menu
  -Install Agile Production module (hg clone http://forge.openbravo.com/hg/repos/agilefixquantities [^] com.openbravo.gps.agileproduction.fixquantities)
  -With a role with default language en_US login in es_ES
  -Go to Production Run and execute Fix Quantities process
  -Check message is tried to be shown in en_US <- Incorrect
2. Scheduled background processes after tomcat restart.
  -Install attached obx
  -Login in English
  -Schedule Process18214
  -Login in Spanish
  -Schedule Process18214
  -Note in openbravo.log process is executed correctly in both languages <-Correct
  -Restart tomcat
  -Note process is executed always in English <- Incorrect
(0047442)
alostale   
2012-04-10 18:04   
This fix is not risky.

Test plan: follow steps mentioned in note above.
(0047443)
hgbot   
2012-04-10 18:15   
Repository: erp/devel/pi
Changeset: 9547870c49c8555e62399b3c1d18ecd523c6a5a9
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Apr 10 18:07:42 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9547870c49c8555e62399b3c1d18ecd523c6a5a9 [^]

fixed bug 20191: Context language is not preserved in processes

  -When creating OBContext for processes extending DalBasesProcess, retrieve
   language and use it.
  -When getting vars from ProcessContext take into account language.

---
M src/org/openbravo/base/secureApp/VariablesSecureApp.java
M src/org/openbravo/scheduling/ProcessContext.java
M src/org/openbravo/service/db/DalBaseProcess.java
---
(0047623)
hudsonbot   
2012-04-17 05:31   
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/cedf57621434 [^]

Maturity status: Test
(0048153)
guilleaer   
2012-04-27 15:10   
code reviewed and tested pi@1f536d3d1619