improved_views

bzr revid: fp@tinyerp.com-20081030075624-q47d58h8btqcvr8i
This commit is contained in:
Fabien Pinckaers 2008-10-30 08:56:24 +01:00
parent 201964cb6b
commit 95ed4f39ad
3 changed files with 8 additions and 26 deletions

View File

@ -247,8 +247,8 @@ class ir_ui_menu(osv.osv):
('ir.actions.report.xml', 'ir.actions.report.xml'),
('ir.actions.act_window', 'ir.actions.act_window'),
('ir.actions.wizard', 'ir.actions.wizard'),
('ir.actions.url', 'ir.actions.act_url'),
]),
('ir.actions.url', 'ir.actions.url'),
]),
}
_defaults = {
'icon' : lambda *a: 'STOCK_OPEN',

View File

@ -253,7 +253,7 @@ class module(osv.osv):
res = {}
model_data_obj = self.pool.get('ir.model.data')
view_obj = self.pool.get('ir.ui.view')
for m in self.browse(cr, uid, ids):
for m in self.browse(cr, uid, ids, context=context):
if m.state == 'installed':
view_txt = ''
view_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.ui.view')])
@ -264,20 +264,6 @@ class module(osv.osv):
res[m.id] = ''
return res
def _get_objects(self, cr, uid, ids, field_name=None, arg=None, context={}):
res = {}
model_data_obj=self.pool.get('ir.model.data')
for m in self.browse(cr, uid, ids):
if m.state=='installed':
cr.execute('''select distinct model from ir_model_data where module = '%s' '''%(m.name))
objects = cr.fetchall()
obj_lst=map(lambda x:x[0],objects)
res[m.id] = '\n'.join(obj_lst)
else:
res[m.id] = ''
return res
_columns = {
'name': fields.char("Name", size=128, readonly=True, required=True),
'category_id': fields.many2one('ir.module.category', 'Category', readonly=True),
@ -307,7 +293,6 @@ class module(osv.osv):
'menus_by_module': fields.function(_get_menus, method=True, string='Menus', type='text'),
'reports_by_module': fields.function(_get_reports, method=True, string='Reports', type='text'),
'views_by_module': fields.function(_get_views, method=True, string='Views', type='text'),
'objects_by_module': fields.function(_get_objects, method=True, string='Objects', type='text'),
}
_defaults = {

View File

@ -96,15 +96,12 @@
</field>
</page>
<page string="Added Features" attrs="{'invisible':[('state','!=','installed')]}">
<!-- <separator string="The following information describes the features provided by this module. It will be completed only if the module is installed" colspan="4"/>-->
<separator string="List of menus introduced by this module" colspan="2"/>
<separator string="List of reports introduced by this module" colspan="2"/>
<field colspan="2" name="menus_by_module" nolabel="1"/>
<field colspan="2" name="reports_by_module" nolabel="1"/>
<separator string="List of views introduced by this module" colspan="2"/>
<separator string="List of objects introduced by this module" colspan="2"/>
<separator string="List of menus" colspan="4"/>
<field colspan="4" name="menus_by_module" nolabel="1"/>
<separator string="List of views" colspan="2"/>
<separator string="List of reports" colspan="2"/>
<field colspan="2" name="views_by_module" nolabel="1"/>
<field colspan="2" name="objects_by_module" nolabel="1"/>
<field colspan="2" name="reports_by_module" nolabel="1"/>
</page>
</notebook>
</form>