[IMP] product, hr, point of sale, mail_group: propagated function name change (now prefixed with image_) in image module.

bzr revid: tde@openerp.com-20120807111039-57cykhxurm2wj79k
This commit is contained in:
Thibault Delavallée
2012-08-07 13:10:39 +02:00
parent 6c4dda8441
commit 023262e519
4 changed files with 11 additions and 27 deletions
+3 -7
View File
@@ -150,15 +150,11 @@ class hr_employee(osv.osv):
def _get_image(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
for obj in self.browse(cr, uid, ids, context=context):
resized_image_dict = tools.get_resized_images(obj.image)
result[obj.id] = {
'image_medium': resized_image_dict['image_medium'],
'image_small': resized_image_dict['image_small'],
}
result[obj.id] = tools.image_get_resized_images(obj.image)
return result
def _set_image(self, cr, uid, id, name, value, args, context=None):
return self.write(cr, uid, [id], {'image': tools.resize_image_big(value)}, context=context)
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
_columns = {
'country_id': fields.many2one('res.country', 'Nationality'),
@@ -262,7 +258,7 @@ class hr_employee(osv.osv):
def _get_default_image(self, cr, uid, context=None):
image_path = addons.get_module_resource('hr', 'static/src/img', 'default_image.png')
return tools.resize_image_big(open(image_path, 'rb').read().encode('base64'))
return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
_defaults = {
'active': 1,
+3 -7
View File
@@ -57,15 +57,11 @@ class mail_group(osv.osv):
def _get_image(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
for obj in self.browse(cr, uid, ids, context=context):
resized_image_dict = tools.get_resized_images(obj.image)
result[obj.id] = {
'image_medium': resized_image_dict['image_medium'],
'image_small': resized_image_dict['image_small'],
}
result[obj.id] = tools.image_get_resized_images(obj.image)
return result
def _set_image(self, cr, uid, id, name, value, args, context=None):
return self.write(cr, uid, [id], {'image': tools.resize_image_big(value)}, context=context)
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
def get_member_ids(self, cr, uid, ids, field_names, args, context=None):
if context is None:
@@ -96,7 +92,7 @@ class mail_group(osv.osv):
def _get_default_image(self, cr, uid, context=None):
image_path = openerp.modules.get_module_resource('mail', 'static/src/img', 'groupdefault.png')
return tools.resize_image_big(open(image_path, 'rb').read().encode('base64'))
return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
_columns = {
'name': fields.char('Name', size=64, required=True),
+3 -7
View File
@@ -1177,15 +1177,11 @@ class pos_category(osv.osv):
def _get_image(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
for obj in self.browse(cr, uid, ids, context=context):
resized_image_dict = tools.get_resized_images(obj.image)
result[obj.id] = {
'image_medium': resized_image_dict['image_medium'],
'image_small': resized_image_dict['image_small'],
}
result[obj.id] = tools.image_get_resized_images(obj.image)
return result
def _set_image(self, cr, uid, id, name, value, args, context=None):
return self.write(cr, uid, [id], {'image': tools.resize_image_big(value)}, context=context)
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True),
@@ -1217,7 +1213,7 @@ class pos_category(osv.osv):
def _get_default_image(self, cr, uid, context=None):
image_path = openerp.modules.get_module_resource('point_of_sale', 'images', 'default_category_photo.png')
return tools.resize_image_big(open(image_path, 'rb').read().encode('base64'))
return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
_defaults = {
'image': _get_default_image,
+2 -6
View File
@@ -494,15 +494,11 @@ class product_product(osv.osv):
def _get_image(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
for obj in self.browse(cr, uid, ids, context=context):
resized_image_dict = tools.get_resized_images(obj.image)
result[obj.id] = {
'image_medium': resized_image_dict['image_medium'],
'image_small': resized_image_dict['image_small'],
}
result[obj.id] = tools.image_get_resized_images(obj.image)
return result
def _set_image(self, cr, uid, id, name, value, args, context=None):
return self.write(cr, uid, [id], {'image': tools.resize_image_big(value)}, context=context)
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
_defaults = {
'active': lambda *a: 1,