Another option is to use a script, which:
- connects to the server
- initializes the model(s) you want to export
- loop through all the models
- write the needed data.
#Example of script
I run openERP V7 on a Ubuntu 12.04 server, and have installed openerp-client-lib
Than I made a script:
import openerplib
line = '-' * 40
h : "localhost"
db : 'test1'
u : "admin"
p : 'test654'
def fieldValues(m):
print line
print '-' *10, m
model = connection.get_model(m)
fields = model.fields_get()
# get the IDs, and sorted by 'id'
ids = model.search([],0,0,'id')
if ids == []:
for f in fields:
print f
for i in ids:
print '-' *15, i
for f in fields:
info = model.read(i, [f])
print f,':', info
def fieldData(m):
print line
print '-' *10, m
model = connection.get_model(m)
# get the IDs, and sorted by 'id'
ids = model.search([],0,0,'id')
for i in ids:
print '-' *15, i
print model.copy_data(i)
#Begin the process of getting data
print line
print '-' * 5, 'Host:', h
print '-' * 5, 'Database:', db
print line
connection = openerplib.get_connection(hostname=h, database=db, login=u, password=p)
models = {
'sale.order',
}
for m in models:
fieldValues(m)
for m in models:
fieldData(m)
print line
#summary
Method fieldValues(m) gives you all the fields of the model, with the associated value.
Method fieldData(m) gives you all the data, including the related models (for example when your model is sale.order, than you also get all the related sale.order.lines).