First be sure you set "Allow users to import data from CSV files" in
Settings >> General Settings. (In fact you must have the module
base_import installed for even that to be possible) After you've done that, a new link will appear, beside the
[Create] button in the
List view (not
Icon view) of the employee directory.
Probably you will need to export to CSV first and then open the CSV into a spreadsheet, in order to see what an import file should look like.
I tried it just now importing into a Google Docs spreadsheet, then downloading as a new CSV file and importing into OpenERP. I can confirm that this correctly created a new user from an existing one. The photo restored correctly, too.
To add new images to your spreadsheet you'll need to use a Base64 encoder
If your employee data is already installed you will face the problem of matching photos to persons. The solution to that is to choose one or two fields that together form some sort of unique identifier. Export just those fields to a file and import it into a spreadsheet workbook (Let's call that Sheet_1). You'll see that an additional "External ID" column will have been created in Sheet_1. Load your Base64 encoded images into a second sheet in the workbook (Sheet_2), keyed with the same unique identifier. In a third sheet (Sheet_3), use the VLOOKUP function on a person in Sheet_1 to get the "External ID" for each image in Sheet_2, and thus form a correctly formatted sheet for exporting back to OpenERP.
If you are just experimenting, you can quickly convert an image to Base64, with a site like http://base64.wutils.com/encoding-online/ for example.
On a "good" Linux distribution, you can just run this:
cat photo.jpg | base64 --wrap=0 > photo.b64
(--wrap=0 ensures no
<cr><lf> cruft sneak into it)
Now, if you want to go completely loopy about this you can try ...
1) A bash script (
MakeBase64CSV.sh) such as ...
echo \"name\",\"image\" > $1.csv
while IFS=, read f1 f2; do
# echo "fields[$f1 $f2 $f3 $f4]"
echo -n \"$f1\",\" >> $1.csv
cat $f2 | base64 --wrap=0 >> $1.csv
echo \" >> $1.csv
done < $1
2) . . . that expects a records file (
PersonPix.txt) such as . . .
Bob Roberts, BobRoberts.png
Carol Karolice, CarolKarolice.png
Ted Edwards, TedEdwards.png
Alice Alder, AliceAlder.png
3) . . . that gets executed like this ...
4) . . . that can be viewed like this . . .
5) . . . spitting out something that'll look like this . . .