diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 3c307b9fee8..239c6777e69 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -180,10 +180,9 @@ class hr_employee(osv.osv): '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 = { diff --git a/addons/mail/mail_group.py b/addons/mail/mail_group.py index fdfeafd4afe..28e62c3b374 100644 --- a/addons/mail/mail_group.py +++ b/addons/mail/mail_group.py @@ -56,13 +56,12 @@ class mail_group(osv.Model): 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 "\ @@ -70,7 +69,7 @@ class mail_group(osv.Model): "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 "\ diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 2d6d8b92da1..65abde1f617 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1211,17 +1211,15 @@ class pos_category(osv.osv): '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 "\ @@ -1229,7 +1227,7 @@ class pos_category(osv.osv): "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 "\ diff --git a/addons/product/product.py b/addons/product/product.py index 16b08e67cee..5ee37c5db64 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -548,13 +548,12 @@ class product_product(osv.osv): '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 "\ @@ -562,7 +561,7 @@ class product_product(osv.osv): "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 "\