Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041620Openbravo ERPA. Platformpublic2019-08-09 08:502019-08-26 10:39
salvador_campanella 
platform 
normalmajoralways
closedno change required 
5
 
 
AugustoMauch
Core
No
0041620: Synchronize Terminology Fails when a Translation is created with a different name than the element related
Synchronize Terminology Fails when a Translation is created with a different name than the element related
1.- Create a new template and put in development
2.- Go to Element window
3.- Select any element and create a new Translation
For example element with the name: Abc

4.- Create a new Translation with a different name
For example ABCDEFG

5.- Synchronize Terminology

The error "more than one row returned by a subquery used as an expression" appears.


No tags attached.
caused by defect 0041689 new Triage Platform Base Synchronize Terminology Fails when a Translation is created with the same language that the module 
png Screenshot from 2019-08-19 12-28-11.png (24,695) 2019-08-19 12:28
https://issues.openbravo.com/file_download.php?file_id=13243&type=bug
png
Issue History
2019-08-09 08:50salvador_campanellaNew Issue
2019-08-09 08:50salvador_campanellaAssigned To => platform
2019-08-09 08:50salvador_campanellaModules => Core
2019-08-09 08:50salvador_campanellaResolution time => 1567116000
2019-08-09 08:50salvador_campanellaTriggers an Emergency Pack => No
2019-08-09 08:57salvador_campanellaSummarySynchronize Terminology when a Translation is created with a different name than the element related => Synchronize Terminology Fails when a Translation is created with a different name than the element related
2019-08-09 08:57salvador_campanellaDescription Updatedbug_revision_view_page.php?rev_id=19288#r19288
2019-08-16 10:20AugustoMauchNote Added: 0114032
2019-08-16 10:20AugustoMauchStatusnew => acknowledged
2019-08-16 10:20AugustoMauchStatusacknowledged => scheduled
2019-08-16 10:20AugustoMauchNote Added: 0114033
2019-08-16 10:20AugustoMauchStatusscheduled => feedback
2019-08-16 10:21AugustoMauchNote Deleted: 0114032
2019-08-19 12:26salvador_campanellaNote Added: 0114084
2019-08-19 12:26salvador_campanellaFile Added: Screenshot from 2019-08-19 12-18-52.png
2019-08-19 12:27salvador_campanellaFile Deleted: Screenshot from 2019-08-19 12-18-52.png
2019-08-19 12:28salvador_campanellaFile Added: Screenshot from 2019-08-19 12-28-11.png
2019-08-26 10:34salvador_campanellaRelationship addedcaused by 0041689
2019-08-26 10:39salvador_campanellaReview Assigned To => AugustoMauch
2019-08-26 10:39salvador_campanellaNote Added: 0114269
2019-08-26 10:39salvador_campanellaStatusfeedback => closed
2019-08-26 10:39salvador_campanellaResolutionopen => no change required

Notes
(0114033)
AugustoMauch   
2019-08-16 10:20   
I could not reproduce this issue creating the translations properly, that is, creating them for languages other than the language of the module of the element.

That is not supported, there can't be an English translation for a element that belongs to a module whose language is English.

Could you check if that is what happened?
(0114084)
salvador_campanella   
2019-08-19 12:26   
if you see the image attached, you can notice that when the traduction is created for the same language that the module the process fails with the error
"more than one row returned by a subquery used as an expression"

Debugging the PL Function ad_sychronize. I noticed that a select query returns two values when the name of the element has traduction for the same language of the module.

This is because when the union statement is made the result is two names. The name of the element set in the module and the name of the element set in the translation.


-- Fields should now be syncronized
    RAISE NOTICE '%','Synchronize Field' ;
    UPDATE AD_FIELD
      SET NAME=
        (SELECT COALESCE(T.NAME, e.NAME)
        FROM AD_COLUMN c,
             AD_MODULE M,
             AD_ELEMENT e, AD_ELEMENT_TRL T
        WHERE e.AD_Element_ID=c.AD_Element_ID
          AND c.AD_Column_ID=AD_FIELD.AD_Column_ID
          AND E.AD_ELEMENT_ID = T.AD_ELEMENT_ID
          AND AD_FIELD.AD_MODULE_ID = M.AD_MODULE_ID
          AND T.AD_LANGUAGE = M.AD_LANGUAGE
          union
      SELECT e.NAME
        FROM AD_COLUMN c,
             AD_MODULE M, AD_MODULE M2,
             AD_ELEMENT e
        WHERE e.AD_Element_ID=c.AD_Element_ID
          AND c.AD_Column_ID=AD_FIELD.AD_Column_ID
          AND AD_FIELD.AD_MODULE_ID = M.AD_MODULE_ID
          AND E.AD_MODULE_ID = M2.AD_MODULE_ID
          AND M2.AD_LANGUAGE = M.AD_LANGUAGE)
(0114269)
salvador_campanella   
2019-08-26 10:39   
This issue is caused because of the translation of the modules can not be the same as the language of the module.

To resolve the root cause was created a new issue: https://issues.openbravo.com/view.php?id=41689 [^]

Regards