[Erp5-dev] Proposal for CSV import/export enhancements

Jérome Perrin jerome at nexedi.com
Wed Oct 17 12:02:29 CEST 2007


Łukasz Nowak a écrit :
> Hello,
> 
> While playing with production we are able to import BOMs and many
> other useful information from various CAD/CAM/etc programs using CSV.
> 
> As CSV is quite...hm...undefined, there are many problems. Many
> programs use different implementation of CSV - some of them use ";" as
> separator some ",". Some use '"' as quote mark, some "'". Some use
> UTF-8 encoding, some other ASCII, and so on. So, IMHO, importing of
> CSV might be two-phase system. First one upload file, second one
> choose some attributes and provide user special listbox, which will
> "simulate" how will system understand provided CSV. Something similar
> to OpenOffice CSV import/export dialog.

Hi,

As you pointed out, despite looking simple, csv is in reality extremly 
complex (you can look at python csv module implementation), that's one 
more reason why we concentrate on importing from OpenOffice. It still 
needs improvement, but here's what we have today:

- Import of categories from a spreadsheet (Import/Export action from 
portal_categories). This uses oood to convert this input file, if for 
instance you upload a .xls file. I haven't try with CSV, I don't know if 
oood can convert from CSV.

  - There is an interesting prototype on person module: "Import Persons 
from OpenOffice Calc".
This tool propose to map openoffice column to document properties. As 
far as I know it doesn't work for categories, and probably have other 
problems, but it's IMHO a good start.

As far as I know this is the current status of OOo import in ERP5. If we 
want better csv support, one way might be to add more csv to ods / ods 
to csv support directly in oood, by "normalizing" csv in python using 
csv module. This is just an idea, I haven't tried it at all, and I'm not 
sure that information like "this column is numeric" can be kept with csv 
only anyway ...

Jérome



More information about the Erp5-dev mailing list