Thibault Delavallée (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-tools-image-tde into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-tools-image-tde/+merge/123241
Image cleaning
- propagated size change in image fields helps
- small cleaning of image fiels helps
- product: image_medium is not up-sized anymore, to avoid having a blank frame
in POS
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-tools-image-tde/+merge/123241
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-tools-image-tde.
=== modified file 'hr/hr.py'
--- hr/hr.py 2012-08-22 11:34:39 +0000
+++ hr/hr.py 2012-09-07 10:01:35 +0000
@@ -180,17 +180,16 @@
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True),
'coach_id': fields.many2one('hr.employee', 'Coach'),
'job_id': fields.many2one('hr.job', 'Job'),
+ # image: all image fields are base64 encoded and PIL-supported
'image': fields.binary("Photo",
- help="This field holds the image used as a photo for the "\
- "employee. The image is base64 encoded, and PIL-supported. "\
- "It is limited to a 1024x1024 px image."),
+ help="This field holds the image used as photo for the employee, limited to 1024x1024px."),
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
string="Medium-sized photo", type="binary", multi="_get_image",
store = {
'hr.employee': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Medium-sized photo of the employee. It is automatically "\
- "resized as a 180x180 px image, with aspect ratio preserved. "\
+ "resized as a 128x128px image, with aspect ratio preserved. "\
"Use this field in form views or some kanban views."),
'image_small': fields.function(_get_image, fnct_inv=_set_image,
string="Smal-sized photo", type="binary", multi="_get_image",
@@ -198,7 +197,7 @@
'hr.employee': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized photo of the employee. It is automatically "\
- "resized as a 50x50 px image, with aspect ratio preserved. "\
+ "resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required."),
'passport_id':fields.char('Passport No', size=64),
'color': fields.integer('Color Index'),
=== modified file 'mail/mail_group.py'
--- mail/mail_group.py 2012-09-04 13:36:48 +0000
+++ mail/mail_group.py 2012-09-07 10:01:35 +0000
@@ -56,25 +56,24 @@
help="Members of those groups will automatically added as followers. "\
"Note that they will be able to manage their subscription manually "\
"if necessary."),
+ # image: all image fields are base64 encoded and PIL-supported
'image': fields.binary("Photo",
- help="This field holds the image used as photo for the "\
- "user. The image is base64 encoded, and PIL-supported. "\
- "It is limited to a 1024x1024 px image."),
+ help="This field holds the image used as photo for the group, limited to 1024x1024px."),
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
string="Medium-sized photo", type="binary", multi="_get_image",
- store = {
+ store={
'mail.group': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Medium-sized photo of the group. It is automatically "\
- "resized as a 180x180px image, with aspect ratio preserved. "\
+ "resized as a 128x128px image, with aspect ratio preserved. "\
"Use this field in form views or some kanban views."),
'image_small': fields.function(_get_image, fnct_inv=_set_image,
string="Small-sized photo", type="binary", multi="_get_image",
- store = {
+ store={
'mail.group': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized photo of the group. It is automatically "\
- "resized as a 50x50px image, with aspect ratio preserved. "\
+ "resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required."),
'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
help="The email address associated with this group. New emails received will automatically "
=== modified file 'point_of_sale/point_of_sale.py'
--- point_of_sale/point_of_sale.py 2012-09-05 15:05:38 +0000
+++ point_of_sale/point_of_sale.py 2012-09-07 10:01:35 +0000
@@ -1211,29 +1211,27 @@
'child_id': fields.one2many('pos.category', 'parent_id', string='Children Categories'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
- # NOTE: there is no 'default image', because by default we don't show thumbnails for categories. However if we have a thumbnail
+ # NOTE: there is no 'default image', because by default we don't show thumbnails for categories. However if we have a thumbnail
# for at least one category, then we display a default image on the other, so that the buttons have consistent styling.
- # In this case, the default image is set by the js code.
-
+ # In this case, the default image is set by the js code.
+ # NOTE2: image: all image fields are base64 encoded and PIL-supported
'image': fields.binary("Image",
- help="This field holds the image used for the category. "\
- "The image is base64 encoded, and PIL-supported. "\
- "It is limited to a 1024x1024 px image."),
+ help="This field holds the image used as image for the cateogry, limited to 1024x1024px."),
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
string="Medium-sized image", type="binary", multi="_get_image",
- store = {
+ store={
'pos.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Medium-sized image of the category. It is automatically "\
- "resized as a 180x180 px image, with aspect ratio preserved. "\
+ "resized as a 128x128px image, with aspect ratio preserved. "\
"Use this field in form views or some kanban views."),
'image_small': fields.function(_get_image, fnct_inv=_set_image,
string="Smal-sized image", type="binary", multi="_get_image",
- store = {
+ store={
'pos.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized image of the category. It is automatically "\
- "resized as a 50x50 px image, with aspect ratio preserved. "\
+ "resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required."),
}
=== modified file 'product/product.py'
--- product/product.py 2012-09-04 07:51:42 +0000
+++ product/product.py 2012-09-07 10:01:35 +0000
@@ -509,7 +509,7 @@
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):
- result[obj.id] = tools.image_get_resized_images(obj.image)
+ result[obj.id] = tools.image_get_resized_images(obj.image, avoid_resize_medium=True)
return result
def _set_image(self, cr, uid, id, name, value, args, context=None):
@@ -548,25 +548,24 @@
'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'),
'name_template': fields.related('product_tmpl_id', 'name', string="Name", type='char', size=128, store=True, select=True),
'color': fields.integer('Color Index'),
+ # image: all image fields are base64 encoded and PIL-supported
'image': fields.binary("Image",
- help="This field holds the image used for the product. "\
- "The image is base64 encoded, and PIL-supported. "\
- "It is limited to a 1024x1024 px image."),
+ help="This field holds the image used as image for the product, limited to 1024x1024px."),
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
string="Medium-sized image", type="binary", multi="_get_image",
- store = {
+ store={
'product.product': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Medium-sized image of the product. It is automatically "\
- "resized as a 180x180 px image, with aspect ratio preserved. "\
- "Use this field in form views or some kanban views."),
+ "resized as a 128x128px image, with aspect ratio preserved, "\
+ "only when the image exceeds one of those sizes. Use this field in form views or some kanban views."),
'image_small': fields.function(_get_image, fnct_inv=_set_image,
string="Small-sized image", type="binary", multi="_get_image",
- store = {
+ store={
'product.product': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized image of the product. It is automatically "\
- "resized as a 50x50 px image, with aspect ratio preserved. "\
+ "resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required."),
'seller_info_id': fields.function(_calc_seller, type='many2one', relation="product.supplierinfo", multi="seller_info"),
'seller_delay': fields.function(_calc_seller, type='integer', string='Supplier Lead Time', multi="seller_info", help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."),
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp