[MERGE] module: improve modules' descriptions rendering and keep it translatable
bzr revid: abo@openerp.com-20120824085944-ocfg80ve695ipdm7
This commit is contained in:
@@ -99,9 +99,8 @@ class module(osv.osv):
|
||||
def _get_desc(self, cr, uid, ids, field_name=None, arg=None, context=None):
|
||||
res = dict.fromkeys(ids, '')
|
||||
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_encoding='unicode')
|
||||
output = publish_string(source=desc, writer_name='html', settings_overrides=overrides)
|
||||
output = publish_string(source=module.description, writer_name='html', settings_overrides=overrides)
|
||||
res[module.id] = output
|
||||
return res
|
||||
|
||||
@@ -193,7 +192,8 @@ 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.function(_get_desc, string='Description', type='html', method=True, readonly=True, store=True),
|
||||
'description': fields.text("Description", readonly=True, translate=True),
|
||||
'description_html': fields.function(_get_desc, string='Description HTML', type='html', method=True, readonly=True),
|
||||
'author': fields.char("Author", size=128, readonly=True),
|
||||
'maintainer': fields.char('Maintainer', size=128, readonly=True),
|
||||
'contributors': fields.text('Contributors', readonly=True),
|
||||
@@ -233,7 +233,7 @@ class module(osv.osv):
|
||||
('AGPL-3', 'Affero GPL-3'),
|
||||
('Other OSI approved licence', 'Other OSI Approved Licence'),
|
||||
('Other proprietary', 'Other Proprietary')
|
||||
], string='License', readonly=True),
|
||||
], string='License', readonly=True),
|
||||
'menus_by_module': fields.function(_get_views, string='Menus', type='text', multi="meta", store=True),
|
||||
'reports_by_module': fields.function(_get_views, string='Reports', type='text', multi="meta", store=True),
|
||||
'views_by_module': fields.function(_get_views, string='Views', type='text', multi="meta", store=True),
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Description">
|
||||
<field name="description"/>
|
||||
<field name="description_html"/>
|
||||
</page>
|
||||
<page string="Technical Data" groups="base.group_no_one">
|
||||
<group col="4">
|
||||
|
||||
Reference in New Issue
Block a user