[FIX] module: fix imports broken at revision 5055
get_module_resource method is required by function fields of ir.module.module bzr revid: mat@openerp.com-20140211105525-tuhs10hb8y3o1rnp
This commit is contained in:
parent
88e8c52702
commit
24b0b132d4
|
@ -41,8 +41,9 @@ except ImportError:
|
||||||
from StringIO import StringIO # NOQA
|
from StringIO import StringIO # NOQA
|
||||||
|
|
||||||
import openerp
|
import openerp
|
||||||
from openerp import modules, tools, addons
|
from openerp import modules, tools
|
||||||
from openerp.modules.db import create_categories
|
from openerp.modules.db import create_categories
|
||||||
|
from openerp.modules import get_module_resource
|
||||||
from openerp.tools.parse_version import parse_version
|
from openerp.tools.parse_version import parse_version
|
||||||
from openerp.tools.translate import _
|
from openerp.tools.translate import _
|
||||||
from openerp.osv import fields, osv, orm
|
from openerp.osv import fields, osv, orm
|
||||||
|
@ -154,7 +155,7 @@ class module(osv.osv):
|
||||||
def _get_desc(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
def _get_desc(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
||||||
res = dict.fromkeys(ids, '')
|
res = dict.fromkeys(ids, '')
|
||||||
for module in self.browse(cr, uid, ids, context=context):
|
for module in self.browse(cr, uid, ids, context=context):
|
||||||
path = addons.get_module_resource(module.name, 'static/description/index.html')
|
path = get_module_resource(module.name, 'static/description/index.html')
|
||||||
if path:
|
if path:
|
||||||
with tools.file_open(path, 'rb') as desc_file:
|
with tools.file_open(path, 'rb') as desc_file:
|
||||||
doc = desc_file.read()
|
doc = desc_file.read()
|
||||||
|
@ -233,7 +234,7 @@ class module(osv.osv):
|
||||||
def _get_icon_image(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
def _get_icon_image(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
||||||
res = dict.fromkeys(ids, '')
|
res = dict.fromkeys(ids, '')
|
||||||
for module in self.browse(cr, uid, ids, context=context):
|
for module in self.browse(cr, uid, ids, context=context):
|
||||||
path = addons.get_module_resource(module.name, 'static', 'description', 'icon.png')
|
path = get_module_resource(module.name, 'static', 'description', 'icon.png')
|
||||||
if path:
|
if path:
|
||||||
image_file = tools.file_open(path, 'rb')
|
image_file = tools.file_open(path, 'rb')
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue