Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014696Openbravo ERPA. Platformpublic2010-09-24 13:022012-05-25 12:11
mtaal 
vmromanos 
normalmajorhave not tried
closedfixed 
5
pi 
pi 
Core
No
0014696: Repair db-views which don't have a primary key defined in ad_column
Also the views in AD_Table should have a primary key defined, so one of the ad_column should be marked with key==true.

Here is the list of db views defined in ad_table which don't have a key column:
0 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceHeaderV because it has no primary key columns
6 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InOutHeaderV because it has no primary key columns
6 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceProdMonth because it has no primary key columns
6 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view BPartnerV because it has no primary key columns
7 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceProdWeek because it has no primary key columns
7 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view OrderOpen because it has no primary key columns
7 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceDay because it has no primary key columns
8 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view DebtPaymentV because it has no primary key columns
8 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceCustomerVendQtr because it has no primary key columns
8 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceLineV2 because it has no primary key columns
9 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view TransactionV because it has no primary key columns
9 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceVendorMonth because it has no primary key columns
9 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view CashDetail because it has no primary key columns
9 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceMonth because it has no primary key columns
9 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceCustomerProdQtr because it has no primary key columns
10 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view TransactionSum because it has no primary key columns
10 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceWeek because it has no primary key columns
10 [main] WARN org.openbravo.base.model.ModelProvider - Ignoring table/view InvoiceV2 because it has no primary key columns
VMA-Reviewed
Issue History
2010-09-24 13:02mtaalNew Issue
2010-09-24 13:02mtaalAssigned To => rafaroda
2010-09-24 13:09rafarodaAssigned Torafaroda => adrianromero
2011-06-03 10:59dalsasuaAssigned Toadrianromero => dalsasua
2011-07-20 18:12dalsasuaAssigned Todalsasua => jonalegriaesarte
2012-02-15 19:05iciordiaAssigned Tojonalegriaesarte => vmromanos
2012-02-16 13:48vmromanosTag Attached: VMA-Reviewed
2012-04-26 10:48vmromanosStatusnew => scheduled
2012-04-26 10:48vmromanosNote Added: 0047997
2012-04-26 10:48vmromanosfix_in_branch => pi
2012-04-26 12:50vmromanosNote Added: 0048020
2012-05-09 13:26hgbotCheckin
2012-05-09 13:26hgbotNote Added: 0048504
2012-05-09 13:26hgbotStatusscheduled => resolved
2012-05-09 13:26hgbotResolutionopen => fixed
2012-05-09 13:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b674e1b44a431ab7080bd0942baadc62c0245fe1 [^]
2012-05-09 17:59miruritaNote Added: 0048524
2012-05-09 17:59miruritaStatusresolved => closed
2012-05-25 12:11hudsonbotCheckin
2012-05-25 12:11hudsonbotNote Added: 0049079

Notes
(0047997)
vmromanos   
2012-04-26 10:48   
The following views are currently affected:
'InvoiceV2'
'InvoiceLineV2'
'TransactionV'
'DebtPaymentV'

select *
from ad_table
where not exists (select 1
                  from ad_column
                  where ad_table.ad_table_id = ad_column.ad_table_id
                  and iskey='Y')
(0048020)
vmromanos   
2012-04-26 12:50   
Test plan I:
1. Run the following SQL query and check no records are shown:
select *
from ad_table
where not exists (select 1
                  from ad_column
                  where ad_table.ad_table_id = ad_column.ad_table_id
                  and iskey='Y')

Test plan II:
2. Take a look at the warn messages when starting tomcat. No warn messages about "Ignoring table/view because it has no primary key columns" should be displayed, although the ModelProvider is now checking it.
(0048504)
hgbot   
2012-05-09 13:26   
Repository: erp/devel/pi
Changeset: b674e1b44a431ab7080bd0942baadc62c0245fe1
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Apr 26 13:39:57 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b674e1b44a431ab7080bd0942baadc62c0245fe1 [^]

Fixed bug 14696: All db tables and views now have a key column

A key column has been added for the following views:
C_DEBT_PAYMENT_V
C_INVOICELINE_V2
C_INVOICE_V2
M_TRANSACTION_V

Apart from that, the mandatory columns (isactive, created,
createdby, updated and updatedby) have been added where missed

Finally the ModelProvider class will now warn about the tables
and views that doesn't have a key column.

---
M src-db/database/model/views/C_DEBT_PAYMENT_V.xml
M src-db/database/model/views/C_INVOICELINE_V2.xml
M src-db/database/model/views/C_INVOICE_V2.xml
M src-db/database/model/views/M_TRANSACTION_V.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src/org/openbravo/base/model/ModelProvider.java
---
(0048524)
mirurita   
2012-05-09 17:59   
code review + testing oK
(0049079)
hudsonbot   
2012-05-25 12:11   
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