Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043275Openbravo ERPA. Platformpublic2020-02-20 06:572020-11-20 13:32
guillermogil 
cberner 
urgentminoralways
closedfixed 
5
 
PR21Q1 
Core
No
0043275: Once you create a new table AD_Org column name is wrong after sync terminology
Once you create a new table AD_Org column name is wrong after sync terminology.

This generates some error:
Table CUSTSHA_DGHelpQ_config has a column referencing AD_Org. The AD_Column.name (note: different from AD_Column.columnname!) of this column should have the value organization, it currently has invoiceOrganization

It happens on every new column created, it requires to assign properly another element and change manually the columname. Not a big effort but you need to notice and it affects always.
On an environment with retail pack installed (did not test without) Create a new table and create the Table record in Openbravo.
Execute sync terminology
You will notice that instead of being Organization is invoiceOrganization.
No tags attached.
Issue History
2020-02-20 06:57guillermogilNew Issue
2020-02-20 06:57guillermogilAssigned To => platform
2020-02-20 06:57guillermogilModules => Core
2020-02-20 06:57guillermogilTriggers an Emergency Pack => No
2020-02-20 09:45shuehnerIssue Monitored: shuehner
2020-11-10 06:58alostalePrioritynormal => urgent
2020-11-10 06:58alostaleStatusnew => acknowledged
2020-11-10 14:07shuehnerNote Added: 0124259
2020-11-18 16:32hgbotNote Added: 0124487
2020-11-20 13:32hgbotResolutionopen => fixed
2020-11-20 13:32hgbotStatusacknowledged => closed
2020-11-20 13:32hgbotNote Added: 0124543
2020-11-20 13:32hgbotFixed in Version => PR21Q1
2020-11-20 13:32hgbotNote Added: 0124544
2020-11-20 13:32alostaleAssigned Toplatform => cberner

Notes
(0124259)
shuehner   
2020-11-10 14:07   
Some notes to workaround & fix that problem if encountered before this issue is resolved.

a.) SQL to find candidate ad_column entries causing it
select t.tablename, c.columnname from ad_column c, ad_table t where c.ad_table_id = t.ad_table_id and c.columnname ilike 'ad_org_id' and c.ad_element_id is null order by 1;

b.) Basic fix is to set ad_element_id='113' for those columns
'113' ad_element is the commonly used one in backoffice (for nearly all cases)

Important note: This needs to be done before running 'synchronize terminology' as without this that process will cause more wrong data (i.e. wrong name column being set to wrong value)
(0124487)
hgbot   
2020-11-18 16:32   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/238 [^]
(0124543)
hgbot   
2020-11-20 13:32   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/238 [^]
(0124544)
hgbot   
2020-11-20 13:32   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 780c0bdb76fd3e537c2312e62d1143b6e0dc8cbb
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-11-20T13:23:14+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/780c0bdb76fd3e537c2312e62d1143b6e0dc8cbb [^]

Fixes ISSUE-43275: On new table, AD_Org column name is wrong after sync terminology

Once a new table is created and sync terminology executed,
the AD_Org element changes to "Invoice Organization" instead of
"Organization". This is done because there are several elements with the
same column name in AD_ELEMENT table and internally the Max
AD_Element_id is being used in the synchronization process.

To avoid this, the main columns are being set to their respective main
elements manually, this only affects newly created tables and has no
effect on existing tables.

---
M src-db/database/model/functions/AD_SYNCHRONIZE.xml
---