This article is based on openerp 6.1.1 and Windows XP may be different in other versions or systems.
This is a summary of personal experience. Some of these situations are personal and may not necessarily apply to everyone.
The tool used to convert the encoding format is notepad ++, at least it is useful in encoding conversion.
1. Export
The export process is very simple. Here we will talk about Garbled text.
When I export it to Excel format, there is no problem. The format is correct and there are no garbled characters.
However, when exported to CSV format, garbled characters (sometimes incorrect format: Values in some ID columns, appears in the cell of the corresponding item ). in this case, you do not need to open it in Excel by default, and use nodepad ++. then convert to UTF-8 format, save. use Excel to open it.
In fact, exporting data in CSV format is rarely used. If exporting data only, simply select Excel format. The most important role of exporting data in CSV format is to prepare for importing data. Let's talk about this below.
Ii. Import
Basic: import the basic table first, and then import the intermediate table.
1. My experience is as follows:
①There must be no space. It does not mean to use Excel to open, but to use nodepad ++. No matter what location, inside or outside the comma, whether it is the header or data.
② Other symbols. The data may contain *, periods (.), ", and so on. After being imported, it will appear in the table as is. Open
ERP Chinese community (http://shine-it.net) has a post said that the import must not have quotation marks, I think the version of the problem or improper operation. The reason is as follows:
If the header is enclosed by quotation marks and the corresponding column data is also enclosed by quotation marks, the data will be imported normally, but the quotation marks will not be displayed. in fact, the CSV format data exported by OE is in the format of quotation marks by default.
Another thing I thought of was, but I didn't try it. I just put spaces in quotation marks. Will it be possible to import spaces?
③ Pay attention to the field type in the table. For example, if the field is float type but the imported data is Chinese characters, an error will occur during the import.
2. Detailed steps
① For basic tables.
Export the data in CSV format (whether the data in the table is unimportant or not, and you can export the data without the data), delete the ID column, copy the data to be imported to the table according to the corresponding fields, and save and close.
Open the file with notepad ++, if there is space in the file, all through the Delete. To see if there are unnecessary commas, quotation marks. Delete. then convert to UTF-8 format, save close.
Then ..... Import the file.
② Non-basic table
Invalid.
At this time, the field names that reference the basic table data in the header will be followed by "/rows,
Table4.xls and so on.
Copy the data to be imported to table1.csv, and replace the data in the columns referenced in the basic table with the corresponding ID. Note that the IDS include"
_ Export __. ", do not take this for granted. this work is quite troublesome. however, fields referenced in a basic table are highly repetitive, and the search and replacement functions in Excel are almost the same. The complexity depends on the data volume in the basic table.
In fact, if there is a large amount of data, it is not difficult to replace the value of a column according to the corresponding relationship. Will there be any formula or Excel itself have this function? Actually, there is still VBA (of course many languages can operate Excel, depending on which one you use skilled). If the data volume is too large, it should be worth writing a simple program.
Finally, everything is OK. Save and close it. Open it with nodepad ++,
If there are spaces in the file, you can delete it. See if there are unnecessary commas, quotation marks. Delete. then convert to UTF-8 format, save close. Then import it.
After you browse and select a file, sometimes some columns do not automatically match, you can just select one. click Import. If an error occurs, a prompt will be displayed. All the errors I encounter are solved using the above three experiences.
Finally, Let's remind you that you should not mix up so many files, exported, imported, original tables, Excel, and CSV files. It is best to put them in different folders.