Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How can I import photos of my employees into HR module?

Subscribe

Get notified when there's activity on this post

This question has been flagged
hrv7
3 Replies
14293 Views
Avatar
Nahedh Alharbi

I have more than 800 .JPG photos for my employees, is there any way to import them into my HR module? I use OpenERP 7 which installed on UBUNTU 12.4 server.

Thank you in advance.

5
Avatar
Discard
Avatar
Martin
Best Answer

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 ...

#!/bin/bash
#
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 ...

./MakeBase64CSV.sh PersonPix.txt

4) . . . that can be viewed like this . . .

cat PersonPix.txt.csv

5) . . . spitting out something that'll look like this . . .

"name","image"
"Bob Roberts","2dd5xU1...milesOfTerrifyingGibberish...fn/3/dO2"
"Carol Karolice","9TU9Pd0...milesOfTerrifyingGibberish...9FwwgDAjKIT"
"Ted Edwards","53xC2vA...milesOfTerrifyingGibberish...DGxGCwkwF"
"Alice Alder","UBQqsm2...milesOfTerrifyingGibberish...yx9YtbHR"
12
Avatar
Discard
Cameron

"use a Base64 encoder" The key :) - now I can progress - many thanks

Martin

up votes gratefully received. :-) (bowing)

Daniel Reis

+1 A recipe for converting to base64 would be a great addition.

Martin

your weesh is mine command line

Nahedh Alharbi
Author

Great, It works with me, thank you very much Martin. :)

Martin

Glad to help!

Alex

Not working. I keep getting No such file or directory on each line. It appears to not be parsing the file to base64 for some reason. Using Centos 6.4.

Alex

It turns out that the file name pair near the end of the CSV was incomplete. So if you get this error, check that each row has a matching image entry!!

Avatar
Andreas Brueckl
Best Answer

I am a friend of python scripts using XMLRPC.

First you should rename all images before the import. Use the OpenERP-ID or the employee name as the image name.

In the script:

  • loop over all images
  • encode file with base64.encode()
  • perform write on object hr.employee with value {'image': b64data} using xmlrpclib
  • if you have named to file with the employee name you first have to search the OpenERP before you can perform the write
1
Avatar
Discard
Michael Karrer

Thanks for the Hint! - Would it be possible to get a bit more detailed description ;) - Thanks in advance!

Avatar
Thuy Ngoc
Best Answer

Hi  Nahedh,

I think this video can help you:

https://www.youtube.com/watch?v=VMJ0UI1crz4&list=PLSKcWRTtEl5qzvRaI-VTGavfReiHS_EEb&index=3

-1
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
There is no reference available for base.element
hr v7
Avatar
0
Mar 15
5073
How do I send out emails to all followers when an update happens in the HR (hiring) module)
hr v7
Avatar
Avatar
1
Mar 15
8265
How to allow manager to access his employees or his department only? Solved
security hr v7
Avatar
Avatar
Avatar
Avatar
14
Sep 24
25938
How to add expense of an employee in employee payslip?
hr v7 expense
Avatar
Avatar
Avatar
2
Sep 17
8887
Payroll Module in openerp
hr v7 payroll
Avatar
Avatar
1
Sep 17
6861
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now