Handle binary fields. Courtesy of Marcel van der Boom

This commit is contained in:
Stefan Rijnhart
2014-12-05 19:27:37 +01:00
committed by Nikul Chaudhary
parent 1272c21ad5
commit 755982bf68
2 changed files with 33 additions and 14 deletions

View File

@@ -4,6 +4,9 @@
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# Snippet from https://github.com/hsd/listview_images
# Copyright (C) 2013 Marcel van der Boom <marcel@hsdev.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
@@ -23,11 +26,12 @@
"version": "1.0",
"author": "Therp BV",
"description": """\
This module defines a tree image widget, to be used with function fields of
type character. Use widget='tree_image' in your view definition. Optionally, set
a 'height' tag. Default height is 16px.
This module defines a tree image widget, to be used with either binary fields
or function fields of type character. Use widget='tree_image' in your view
definition. Optionally, set a 'height' tag. Default height is 16px.
The content of the field can be any of the following:
If you use the widget with a character field, the content of the field can be
any of the following:
* the absolute or relative location of an image. For example, \
"/<module>/static/src/img/youricon.png"
@@ -35,9 +39,8 @@ The content of the field can be any of the following:
* a standard icon from the web distribution, without path or extension, For \
example, 'gtk-open'
* A dynamic image in a data url base 64 format. To show a regular image field \
from the model, use a function field wrapper that retrieves the image with \
bin_size=False in the context, and prefix with 'data:image/png;base64,'
* A dynamic image in a data url base 64 format. Prefix with \
'data:image/png;base64,'
""",
'depends': [
'web',