Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013470Openbravo ERPJ. Demo datapublic2010-05-28 11:392011-07-20 18:12
FrancescoFinamore 
jonalegriaesarte 
normalminoralways
newopen 
20Community Appliance
2.50MP8 
 
Core
No
0013470: Modularize Sample Data
I need to customize the Sample Data ,
for example i have a module an add a column em_xx_name to c_invoice with condition em_xx_name is not null;
with smallbazaar.xml this condition isn't satisfied so when i launch install.source the task fails.
It should be nice have a procedure to customize the sampledata in smallbazaar.xml with data that comes from a module.
No tags attached.
Issue History
2010-05-28 11:39FrancescoFinamoreNew Issue
2010-05-28 11:39FrancescoFinamoreAssigned To => adrianromero
2010-05-28 18:10shuehnerNote Added: 0027817
2010-05-31 16:24FrancescoFinamoreNote Added: 0027834
2010-05-31 17:02shuehnerNote Added: 0027837
2010-06-04 13:45FrancescoFinamoreNote Added: 0027957
2011-06-03 10:59dalsasuaAssigned Toadrianromero => dalsasua
2011-07-20 18:12dalsasuaAssigned Todalsasua => jonalegriaesarte

Notes
(0027817)
shuehner   
2010-05-28 18:10   
Hi Francesco,

this change (adding not null fields) when done in ERP-core would not be allowed explicitely because of the failure with existing data (independent if its sampledata or possibly existing customer data).

However there are two features available which can perhaps help you. First if you define a default-value for your field, it will also be used to populate the new field for existing rows (note: not sure if that is already be present in MP8)

Second feature: there's a special default value which can be defined per column called: onCreateDefault, which is especially used only in the update to populate your not-null column, and not used later for normal new rows)

Using one of those (if possible) would just make your new column work with any possibly existing data (including smallbazaar)
(0027834)
FrancescoFinamore   
2010-05-31 16:24   
Hi Shuehner
So using one of these 2 options , the task install.source will work ?

Thanks.
(0027837)
shuehner   
2010-05-31 17:02   
Hi,

yes it should. At openbravo we some automated test which enforces each new mandatory column to have one of those option to be accepted.

Please check my note the onCreateDefault should work on any version, the use of the normal default for onCreateDefault was only added recently.

Stefan
(0027957)
FrancescoFinamore   
2010-06-04 13:45   
Hi Shuehner

But if i use this option , the task export.client produce the values for the new columns on the xml files ?