Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038517Openbravo ERPA. Platformpublic2018-05-10 15:452018-05-28 16:08
jarmendariz 
jarmendariz 
normalminoralways
closedfixed 
5
 
3.0PR18Q2 
caristu
Core
No
0038517: test11461 can fail when a Translation pack is installed.
IssuesTest.test11461() creates a Form and a associated FormTrl object of which language is set to the first language retrieved by OBDal. If this language happens to be installed, save() will fail as the FormTrl object was already created when saving the Form object.
In a system with a Translation pack installed (e.g. es_ES), run IssuesTest.test11461() a number of times and it'll eventually fail.

But, to make it reproducible you can just change this line:
formTrl.setLanguage(OBDal.getInstance().createCriteria(Language.class).list().get(0));

with this one (assumming you've installed the es_ES translation pack):
formTrl.setLanguage(OBDal.getInstance().get(Language.class, "140"));

And run again the test.
Choose any language that is not installed. That is, any language which issystemlanguage is set to 'N'
No tags attached.
Issue History
2018-05-10 15:45jarmendarizNew Issue
2018-05-10 15:45jarmendarizAssigned To => platform
2018-05-10 15:45jarmendarizModules => Core
2018-05-10 15:45jarmendarizTriggers an Emergency Pack => No
2018-05-10 15:45jarmendarizStatusnew => scheduled
2018-05-10 16:35hgbotCheckin
2018-05-10 16:35hgbotNote Added: 0104457
2018-05-10 16:35hgbotStatusscheduled => resolved
2018-05-10 16:35hgbotResolutionopen => fixed
2018-05-10 16:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/76d2f588a1c71192ba7ce77e2893d896685a58fa [^]
2018-05-10 16:35jarmendarizAssigned Toplatform => jarmendariz
2018-05-10 16:36jarmendarizReview Assigned To => caristu
2018-05-14 13:09hudsonbotCheckin
2018-05-14 13:09hudsonbotNote Added: 0104493
2018-05-25 13:46hgbotCheckin
2018-05-25 13:46hgbotNote Added: 0104715
2018-05-25 13:47caristuNote Added: 0104716
2018-05-25 13:47caristuStatusresolved => closed
2018-05-25 13:47caristuFixed in Version => 3.0PR18Q2
2018-05-28 16:08hudsonbotCheckin
2018-05-28 16:08hudsonbotNote Added: 0104752

Notes
(0104457)
hgbot   
2018-05-10 16:35   
Repository: erp/devel/pi
Changeset: 76d2f588a1c71192ba7ce77e2893d896685a58fa
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Thu May 10 16:03:18 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/76d2f588a1c71192ba7ce77e2893d896685a58fa [^]

Fixed issue 38517: Test fails sometimes when translation pack is installed.

Requesting the first language retrieved by OBDal with no criteria or order may
return a language that is already installed. This leads to an exception as the
FormTrl object was already created when saving Form and there cannot be 2 form
translations with the same associated Form ID and language.

---
M src-test/src/org/openbravo/test/dal/IssuesTest.java
---
(0104493)
hudsonbot   
2018-05-14 13:09   
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/ed385e0e027b [^]
Maturity status: Test
(0104715)
hgbot   
2018-05-25 13:46   
Repository: erp/devel/pi
Changeset: de341e9611c217acabef4125102266d35d14cc90
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri May 25 13:44:24 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/de341e9611c217acabef4125102266d35d14cc90 [^]

related to issue 38517: not need to load the list of languages in memory

---
M src-test/src/org/openbravo/test/dal/IssuesTest.java
---
(0104716)
caristu   
2018-05-25 13:47   
Code reviewed + tested OK.
(0104752)
hudsonbot   
2018-05-28 16:08   
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/816950756de8 [^]
Maturity status: Test