I have more then 500 images in .jpg format, and all are less than 50kbs.
All images have ID, and all employees have the same ID.
I am using Odoo 10.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I have more then 500 images in .jpg format, and all are less than 50kbs.
All images have ID, and all employees have the same ID.
I am using Odoo 10.
Hi,
This code get all files on image_dir and use files names as an id to update employees.
You can use it in a specific odoo module or via a python web-service.
image_dir = 'Path to your image folder'
for root, dirs, filenames in os.walk(image_dir):
for f in filenames:
self.env['hr.employee'].write(int(f.split('.')[0]),{'image':base64.encodestring(open(os.path.join(root, f), 'rb').read())})
Best regards
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up