[IMP] Core features on modules, better views for modules
bzr revid: fp@tinyerp.com-20111206111531-qdkajwatqzb0dz45
This commit is contained in:
parent
1719b9408b
commit
f7d4c3384d
|
@ -287,6 +287,7 @@ CREATE TABLE ir_module_module (
|
|||
name character varying(128) NOT NULL,
|
||||
author character varying(128),
|
||||
url character varying(128),
|
||||
icon character varying(64),
|
||||
state character varying(16),
|
||||
latest_version character varying(64),
|
||||
shortdesc character varying(256),
|
||||
|
@ -294,6 +295,7 @@ CREATE TABLE ir_module_module (
|
|||
category_id integer REFERENCES ir_module_category ON DELETE SET NULL,
|
||||
certificate character varying(64),
|
||||
description text,
|
||||
core boolean default False,
|
||||
demo boolean default False,
|
||||
web boolean DEFAULT FALSE,
|
||||
license character varying(32),
|
||||
|
|
|
@ -215,6 +215,7 @@ class module(osv.osv):
|
|||
'views_by_module': fields.function(_get_views, method=True, string='Views', type='text', multi="meta", store=True),
|
||||
'certificate' : fields.char('Quality Certificate', size=64, readonly=True),
|
||||
'web': fields.boolean('Has a web component', readonly=True),
|
||||
'core': fields.boolean('Is a Core Application', readonly=True),
|
||||
'icon': fields.char('Icon URL', size=128),
|
||||
'complexity': fields.selection([('easy','Easy'), ('normal','Normal'), ('expert','Expert')],
|
||||
string='Complexity', readonly=True,
|
||||
|
|
|
@ -39,24 +39,16 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Search modules">
|
||||
<group col='10' colspan='4'>
|
||||
<filter icon="terp-check" string="Main Apps" domain="[('core', '=', 1)]"/>
|
||||
<filter icon="terp-check" string="Extra" domain="[('core', '=', 0)]"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-check" string="Installed" domain="[('state', 'in', ['installed', 'to upgrade', 'to remove'])]"/>
|
||||
<filter icon="terp-dialog-close" string="Not Installed" domain="[('state', 'in', ['uninstalled', 'uninstallable'])]"/>
|
||||
<filter icon="terp-gtk-jump-to-ltr" string="To be upgraded" domain="[('state','in', ['to upgrade', 'to remove', 'to install'])]"/>
|
||||
<filter icon="terp-dialog-close" string="Not Installed" domain="[('state', 'in', ['uninstalled', 'uninstallable', 'to install'])]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-camera_test" string="Certified" domain="[('certificate','<>', False)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="complexity"/>
|
||||
<field name="description"/>
|
||||
<field name="dependencies_id"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
|
||||
<filter string="Author" icon="terp-personal" domain="[]" context="{'group_by':'author'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'category_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<field name="name"
|
||||
domain="['|','|', ('name','ilike',self), ('description','ilike',self), ('shortdesc','ilike',self) ]"
|
||||
string="Name / Keywords"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
@ -118,13 +110,16 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Module">
|
||||
<field name="name" select="1"/>
|
||||
<field name="certificate" />
|
||||
<field colspan="4" name="shortdesc" select="2"/>
|
||||
<field name="category_id"/>
|
||||
<field name="complexity"/>
|
||||
<field name="demo" readonly="1"/>
|
||||
<field name="icon"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name"/>
|
||||
<field name="shortdesc"/>
|
||||
<field name="certificate" />
|
||||
<field name="category_id"/>
|
||||
<field name="complexity"/>
|
||||
<field name="demo"/>
|
||||
<field name="icon"/>
|
||||
<field name="core"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Module">
|
||||
<group colspan="4" col="4">
|
||||
|
|
|
@ -75,14 +75,14 @@ def initialize(cr):
|
|||
|
||||
cr.execute('INSERT INTO ir_module_module \
|
||||
(author, website, name, shortdesc, description, \
|
||||
category_id, state, certificate, web, license, complexity) \
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
|
||||
category_id, state, certificate, web, license, complexity, core, icon) \
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
|
||||
info['author'],
|
||||
info['website'], i, info['name'],
|
||||
info['description'], category_id, state, info['certificate'],
|
||||
info['web'],
|
||||
info['license'],
|
||||
info['complexity']))
|
||||
info['complexity'], info['core'], info['icon']))
|
||||
id = cr.fetchone()[0]
|
||||
cr.execute('INSERT INTO ir_model_data \
|
||||
(name,model,module, res_id, noupdate) VALUES (%s,%s,%s,%s,%s)', (
|
||||
|
|
|
@ -250,6 +250,8 @@ def load_information_from_description_file(module):
|
|||
info.setdefault('name', False)
|
||||
info.setdefault('description', '')
|
||||
info.setdefault('complexity', 'normal')
|
||||
info.setdefault('core', False)
|
||||
info.setdefault('icon', '')
|
||||
info['certificate'] = info.get('certificate') or None
|
||||
info['web'] = info.get('web') or False
|
||||
info['license'] = info.get('license') or 'AGPL-3'
|
||||
|
|
Loading…
Reference in New Issue