[IMP] icon management in modules

* If icon is present in descriptor file, use that path
* Else try to find #{module}/static/src/img/icon.png
* Else fallback on /base/static/src/img/icon.png

bzr revid: xmo@openerp.com-20111209122803-elwonegpl8kut7pf
This commit is contained in:
Xavier Morel 2011-12-09 13:28:03 +01:00
parent c25475879c
commit 9e94b86bfe
2 changed files with 6 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -218,6 +218,11 @@ def get_module_resource(module, *args):
return resource_path
return False
def get_module_icon(module):
iconpath = ['static', 'src', 'img', 'icon.png']
if get_module_resource(module, *iconpath):
return ('/' + module + '/') + '/'.join(iconpath)
return '/base/' + '/'.join(iconpath)
def load_information_from_description_file(module):
"""
@ -241,7 +246,7 @@ def load_information_from_description_file(module):
'complexity': 'normal',
'depends': [],
'description': '',
'icon': None,
'icon': get_module_icon(module),
'installable': True,
'license': 'AGPL-3',
'name': False,