Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0008031Openbravo ERPA. Platformpublic2009-03-09 16:322009-04-22 00:01
shuehner 
mtaal 
normalmajoralways
closedfixed 
5
pi 
2.50 
Core
No
0008031: export.database (for core) fails with new column of new module inside core table
Adding a new column in a newly created module to a column in a core table and then doing export.database with having core and the new module indevelopment='Y' fails.

Error message is that the new column is present in the application dictionary but not in the database, even when it is in the db,
- Create a new module (just entry in the application, no need to register it)
  - set the new module as indevelopment
  - set the dbprefix to: 'howto'
- set the core-module to indevelopment
- Add a new db-column to an existing core table:
ALTER TABLE m_productprice ADD COLUMN em_howto_calc_average_price CHARACTER(1) NOT NULL DEFAULT ;
- Go to Tables and columns and navigate to the m_productprice table. Use the 'create columns from database' to import the new column into the application distionary.
- Change the module for the new column to the newly created module.
- try to use 'ant export.database'

See the described error message when trying to export the core module.
No tags attached.
diff workaround_to_highlight_problem.diff (900) 2009-03-09 16:33
https://issues.openbravo.com/file_download.php?file_id=973&type=bug
Issue History
2009-03-09 16:32shuehnerNew Issue
2009-03-09 16:32shuehnerAssigned To => mtaal
2009-03-09 16:32shuehnerRegression testing => No
2009-03-09 16:33shuehnerFile Added: workaround_to_highlight_problem.diff
2009-03-09 16:35shuehnerNote Added: 0014528
2009-03-10 10:51hgbotCheckin
2009-03-10 10:51hgbotNote Added: 0014540
2009-03-10 10:51hgbotStatusnew => resolved
2009-03-10 10:51hgbotResolutionopen => fixed
2009-03-10 10:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/52cb0e69a9dcb63e811b14b717986a89bca4b6f5 [^]
2009-04-21 10:53psarobeStatusresolved => closed
2009-04-22 00:01anonymoussf_bug_id0 => 2778058

Notes
(0014528)
shuehner   
2009-03-09 16:35   
Attached patch to pinpoint the place where most likely the problem pops up. The lines commented out by the patch force the validation to be run for the new module (belonging to module A) when trying to export the module core. => column from a not in module core (not in list of columns read from ddlutils) => error column from ad does not exist in db.
(0014540)
hgbot   
2009-03-10 10:51   
Repository: erp/devel/pi
Changeset: 52cb0e69a9dcb63e811b14b717986a89bca4b6f5
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 10 10:50:52 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/52cb0e69a9dcb63e811b14b717986a89bca4b6f5 [^]

Fixes issue 8031: export.database (for core) fails with new column of new module inside core table

---
M src/org/openbravo/service/system/DatabaseValidator.java
---