Ejemplo n.º 1
0
    def _get_default_image(self, cr, uid, is_company, context=None, colorize=False):
        img_path = openerp.modules.get_module_resource('base', 'static/src/img',
                                                       ('company_image.png' if is_company else 'avatar.png'))
        with open(img_path, 'rb') as f:
            image = f.read()

        # colorize user avatars
        if not is_company:
            image = tools.image_colorize(image)

        return tools.image_resize_image_big(image.encode('base64'))
Ejemplo n.º 2
0
 def _set_image(self, cr, uid, id, name, value, args, context=None):
     return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
Ejemplo n.º 3
0
 def _set_image(self, cr, uid, id, field_name, field_value, arg,
                context=None):
     return self.write(cr, uid, [id], {
         'image': tools.image_resize_image_big(field_value),
     }, context=context)
Ejemplo n.º 4
0
 def _get_default_image(self, cr, uid, context=None):
     image_path = addons.get_module_resource('res_users_kanban', 'static/src/img', 'default_image.png')
     return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
 def _get_default_image(self, cr, uid, context=None):
     image_path = addons.get_module_resource('res_users_kanban',
                                             'static/src/img',
                                             'default_image.png')
     return tools.image_resize_image_big(
         open(image_path, 'rb').read().encode('base64'))