Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020345Openbravo ERPA. Platformpublic2012-04-25 10:332012-05-28 08:55
AugustoMauch 
AugustoMauch 
highmajoralways
closedfixed 
5
 
3.0MP123.0MP12 
Core
No
0020345: Verify Language process is creating more records than needed
The Verify Language process should create translation records for all the system languages, but not if language of the message to be translated is the same as its module language.

Example:
- System languages: English, Spanish
- The language of the messages in AD_Message that belong to the Core module is English, so it will not need and English translation.
- Right now, if the Verify Language process is executed, it will create both Spanish and English translations for all the messages of Core.
- Login as System Administrator
- Open the Message window
- Add a new message to the core module.
- Check that no English translation was automatically created for the message.
- Open the Language window
- Open the Spanish (Spain) record, check it as System Language, and execute the Verify Language process.
- Check that two translations have been added to the previously created message: one for Spanish (correct) and one for English (wrong)
- Modify the Verify Language process so that it does not add wrong translations
- Create a configuration script to delete all the wrong traslations that have been created in the past.
No tags attached.
related to design defect 0013627pi acknowledged AugustoMauch verify languages process shouldn't populate c_tax_trl table 
related to defect 00208903.0MP12 closed AugustoMauch The update.database process of MP12 deletes some translations of the messages 
diff issue20345.diff (20,327) 2012-04-27 14:19
https://issues.openbravo.com/file_download.php?file_id=5177&type=bug
Issue History
2012-04-25 10:33AugustoMauchNew Issue
2012-04-25 10:33AugustoMauchAssigned To => AugustoMauch
2012-04-25 10:33AugustoMauchModules => Core
2012-04-26 13:07alostaleRelationship addedrelated to 0013627
2012-04-27 14:19AugustoMauchFile Added: issue20345.diff
2012-05-03 15:59hgbotCheckin
2012-05-03 15:59hgbotNote Added: 0048336
2012-05-03 15:59hgbotStatusnew => resolved
2012-05-03 15:59hgbotResolutionopen => fixed
2012-05-03 15:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/303dc1728c72bccac5be5f0df86590bd17348e0f [^]
2012-05-03 16:03AugustoMauchNote Added: 0048340
2012-05-03 16:03AugustoMauchNote Added: 0048341
2012-05-03 16:07AugustoMauchNote Added: 0048342
2012-05-03 16:08AugustoMauchNote Added: 0048343
2012-05-03 18:41hgbotCheckin
2012-05-03 18:41hgbotNote Added: 0048359
2012-05-16 09:39alostaleNote Added: 0048682
2012-05-16 09:39alostaleStatusresolved => new
2012-05-16 09:39alostaleResolutionfixed => open
2012-05-16 09:40alostaleNote Edited: 0048682bug_revision_view_page.php?bugnote_id=0048682#r3469
2012-05-16 12:37hgbotCheckin
2012-05-16 12:37hgbotNote Added: 0048692
2012-05-16 12:37hgbotStatusnew => resolved
2012-05-16 12:37hgbotResolutionopen => fixed
2012-05-16 12:37hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/303dc1728c72bccac5be5f0df86590bd17348e0f [^] => http://code.openbravo.com/erp/devel/pi/rev/e260a84b287f1ea62ca73d6955f378c549708037 [^]
2012-05-25 12:09hudsonbotCheckin
2012-05-25 12:09hudsonbotNote Added: 0049010
2012-05-25 12:09hudsonbotCheckin
2012-05-25 12:09hudsonbotNote Added: 0049018
2012-05-25 12:12hudsonbotCheckin
2012-05-25 12:12hudsonbotNote Added: 0049144
2012-05-28 08:55alostaleNote Added: 0049317
2012-05-28 08:55alostaleStatusresolved => closed
2012-05-28 08:55alostaleFixed in Version => 3.0MP12
2012-06-28 17:24AugustoMauchRelationship addedrelated to 0020890

Notes
(0048336)
hgbot   
2012-05-03 15:59   
Repository: erp/devel/pi
Changeset: 303dc1728c72bccac5be5f0df86590bd17348e0f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 03 15:58:38 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/303dc1728c72bccac5be5f0df86590bd17348e0f [^]

Fixes issue 20345: Verify Language process is creating more records than needed

This fix prevents the Verify Language process from creating automatically redundant traslation (module language = translation language).

It also includes a module script to delete the redundant translations that have been irregularly created.

---
M src-db/database/model/functions/AD_LANGUAGE_CREATE.xml
A src-util/modulescript/build/classes/org/openbravo/modulescript/DeleteRedundantTranslations.class
A src-util/modulescript/build/classes/org/openbravo/modulescript/DeleteRedundantTranslationsData.class
A src-util/modulescript/src/org/openbravo/modulescript/DeleteRedundantTranslations.java
A src-util/modulescript/src/org/openbravo/modulescript/DeleteRedundantTranslations_data.xsql
---
(0048340)
AugustoMauch   
2012-05-03 16:03   
The Verify Language will no longer add to ad_message_trl translation in the same language as the ad_message module, neither english translations to c_country_trl, c_currency_trl, c_doctype_trl, c_elementvalue_trl, c_greeting_trl, c_payment_term_trl, c_taxcategory_trl, c_tax_trl and c_uom_trl.

The module script will only delete the redundant translations from ad_message.
(0048341)
AugustoMauch   
2012-05-03 16:03   
This is not a risky change.
(0048342)
AugustoMauch   
2012-05-03 16:07   
Test plan:
- Login as System Admin
- Open the Language window
- Check Spanish (Spain) as System Language, and save.
- Open the Message window.
- Create a new Message (use core or any module in English). When the message is saved it should automatically add a Spanish traslation.
- Open the Language window again
- Check Catalan (Spain) as System Language.
- Run the Verify Languages process
- Open the previously created message. A new translation in Catalan should have been created. No English translation should have been created.
(0048343)
AugustoMauch   
2012-05-03 16:08   
Test plan (module script):
- Check that no messages from English modules have a translation in English.
(0048359)
hgbot   
2012-05-03 18:41   
Repository: erp/devel/pi
Changeset: bf22dabdd58c46c9342d5d9761d95bb7c1a234a0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 03 18:40:23 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bf22dabdd58c46c9342d5d9761d95bb7c1a234a0 [^]

Related to issue 20345: Test provisionally ignored

A test is being ignored because it needed and English translation of a month in the c_month_trl table. When another two part unique constrait is found, the test will be used again

---
M src-test/org/openbravo/test/system/ErrorTextParserTest.java
---
(0048682)
alostale   
2012-05-16 09:39   
(edited on: 2012-05-16 09:40)
Reopening due to code review:
-When calculating core's language, don't use module name but id, as name might change.
-Don't query each time for core's language as it is constant, query once and keep it in a variable.
-Update year in license

(0048692)
hgbot   
2012-05-16 12:37   
Repository: erp/devel/pi
Changeset: e260a84b287f1ea62ca73d6955f378c549708037
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed May 16 12:36:15 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e260a84b287f1ea62ca73d6955f378c549708037 [^]

Fixes issue 20345: Code review changes applied

Now the field used to retrieve the language of the core module is ad_module_id (0) instead of name ('Core', it may vary in the future). Instead of executing the consult every time the language is needed, it is executed once and the returned value is saved in a variable.
The year in the license has been updated.

---
M src-db/database/model/functions/AD_LANGUAGE_CREATE.xml
---
(0049010)
hudsonbot   
2012-05-25 12: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/5401e185a8b0 [^]

Maturity status: Test
(0049018)
hudsonbot   
2012-05-25 12: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/5401e185a8b0 [^]

Maturity status: Test
(0049144)
hudsonbot   
2012-05-25 12:12   
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/5401e185a8b0 [^]

Maturity status: Test
(0049317)
alostale   
2012-05-28 08:55   
code reviewed and verified on pi@87f24231e3f1