[IMP]description to rst2html
bzr revid: pna@tinyerp.com-20120820062734-fqt46hxmgv35tlgf
This commit is contained in:
@@ -29,6 +29,7 @@ from openerp import modules, pooler, release, tools, addons
|
||||
from openerp.tools.parse_version import parse_version
|
||||
from openerp.tools.translate import _
|
||||
from openerp.osv import fields, osv, orm
|
||||
from docutils.core import publish_string
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -94,6 +95,15 @@ class module(osv.osv):
|
||||
'module %s', name, exc_info=True)
|
||||
return info
|
||||
|
||||
def _get_desc(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
||||
res = {}
|
||||
for module in self.browse(cr, uid, ids, context=context):
|
||||
desc = self.get_module_info(module.name).get('description', '')
|
||||
overrides = dict(embed_stylesheet= False, doctitle_xform= False)
|
||||
output = publish_string(source= desc, writer_name= 'html', settings_overrides= overrides)
|
||||
res[module.id] = output
|
||||
return res
|
||||
|
||||
def _get_latest_version(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
||||
res = dict.fromkeys(ids, '')
|
||||
for m in self.browse(cr, uid, ids):
|
||||
@@ -182,7 +192,7 @@ class module(osv.osv):
|
||||
'category_id': fields.many2one('ir.module.category', 'Category', readonly=True, select=True),
|
||||
'shortdesc': fields.char('Module Name', size=64, readonly=True, translate=True),
|
||||
'summary': fields.char('Summary', size=64, readonly=True, translate=True),
|
||||
'description': fields.text("Description", readonly=True, translate=True),
|
||||
'description': fields.function(_get_desc, string='Description', type='html', method=True),
|
||||
'author': fields.char("Author", size=128, readonly=True),
|
||||
'maintainer': fields.char('Maintainer', size=128, readonly=True),
|
||||
'contributors': fields.text('Contributors', readonly=True),
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<field name="model">ir.module.module</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search modules">
|
||||
<field name="name" filter_domain="['|', '|', '|', ('description', 'ilike', self), ('summary', 'ilike', self), ('shortdesc', 'ilike', self), ('name',
|
||||
<field name="name" filter_domain="['|', '|', ('summary', 'ilike', self), ('shortdesc', 'ilike', self), ('name',
|
||||
'ilike', self)]"/>
|
||||
<filter name="app" icon="terp-check" string="Apps" domain="[('application', '=', 1)]"/>
|
||||
<filter name="extra" icon="terp-check" string="Extra" domain="[('application', '=', 0)]"/>
|
||||
|
||||
Reference in New Issue
Block a user