From 023262e5192de91d51c480db867ac009674d1ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 7 Aug 2012 13:10:39 +0200 Subject: [PATCH] [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 --- addons/hr/hr.py | 10 +++------- addons/mail/mail_group.py | 10 +++------- addons/point_of_sale/point_of_sale.py | 10 +++------- addons/product/product.py | 8 ++------ 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index d638549deee..aaada8a2d75 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -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, diff --git a/addons/mail/mail_group.py b/addons/mail/mail_group.py index 42180bd0a50..4bf180ecc36 100644 --- a/addons/mail/mail_group.py +++ b/addons/mail/mail_group.py @@ -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), diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 569c944b023..3ee61c45765 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -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, diff --git a/addons/product/product.py b/addons/product/product.py index d71ab6c2795..b0da88dfce8 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -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,