merge from trunk

bzr revid: rco@openerp.com-20111209101101-ut4brstg8nmet03c
This commit is contained in:
Raphael Collet 2011-12-09 11:11:01 +01:00
commit 705e3a1346
8 changed files with 81 additions and 35 deletions

View File

@ -99,5 +99,6 @@
'installable': True,
'active': True,
'certificate': '0076807797149',
"css": [ 'static/src/css/modules.css' ],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -295,7 +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,
application boolean default False,
demo boolean default False,
web boolean DEFAULT FALSE,
license character varying(32),

View File

@ -215,7 +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),
'application': fields.boolean('Application', readonly=True),
'icon': fields.char('Icon URL', size=128),
'complexity': fields.selection([('easy','Easy'), ('normal','Normal'), ('expert','Expert')],
string='Complexity', readonly=True,

View File

@ -39,8 +39,8 @@
<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)]"/>
<filter icon="terp-check" string="Apps" domain="[('application', '=', 1)]"/>
<filter icon="terp-check" string="Extra" domain="[('application', '=', 0)]"/>
<separator orientation="vertical"/>
<filter icon="terp-check" string="Installed" domain="[('state', 'in', ['installed', 'to upgrade', 'to remove'])]"/>
@ -62,34 +62,37 @@
<field name="model">ir.module.module</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban>
<field name="name"/>
<field name="icon"/>
<field name="complexity"/>
<field name="category_id"/>
<field name="state"/>
<templates>
<t t-name="kanban-box">
<table border="0">
<tr>
<td>
<img src="/web/static/src/img/header-preferences.png"/>
</td><td>
<field name="name"/><br/>
<field name="category_id"/><br/>
<field name="complexity"/><br/>
<field name="state"/>
</td>
</tr>
</table>
</t>
</templates>
</kanban>
<kanban>
<field name="icon"/>
<field name="name"/>
<field name="state"/>
<field name="complexity"/>
<templates>
<t t-name="kanban-box">
<a type="edit">
<img t-attf-src="/#{record.name.value}/static/images/icon.png" class="oe_module_icon"/>
</a>
<div class="oe_module_desc">
<h4><a type="edit"><field name="shortdesc"/></a></h4>
<p>
<field name="category_id"/><br/>
<span t-if="record.complexity.raw_value == 'Expert'" class="oe_label oe_warning">Complex</span>
</p>
<a type="object" name="button_install" states="uninstalled" class="button">Install</a>
<button t-if="record.state.raw_value == 'installed'" class="label" disabled="disabled">Installed</button>
</div>
<script>
$('.oe_module_icon').error(function() { $(this).attr('src', "/base/static/src/img/kanban_partner.png"); });
$('a .oe_module_icon').error(function() { $(this).attr('src', "/base/static/src/img/kanban_partner.png"); });
</script>
</t>
</templates>
</kanban>
</field>
</record>
<record id="action_module_open_categ" model="ir.actions.act_window">
<field name="name">Modules</field>
<field name="res_model">ir.module.module</field>
@ -121,7 +124,7 @@
<field name="complexity"/>
<field name="demo"/>
<field name="icon"/>
<field name="core"/>
<field name="application"/>
</group>
<notebook colspan="4">
<page string="Module">
@ -194,7 +197,7 @@
<field name="name">Modules</field>
<field name="res_model">ir.module.module</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,kanban</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain"/>
<field name="search_view_id" ref="view_module_filter"/>
<field name="help">You can install new modules in order to activate new features, menu, reports or data in your OpenERP instance. To install some modules, click on the button "Install" from the form view and then click on "Start Upgrade".</field>

View File

@ -63,6 +63,9 @@
<!-- In case the action is an act_window,
overrides its own @views. -->
<rng:optional><rng:attribute name="view_mode"/></rng:optional>
<!-- Add a 'Create' button in order to create a new resource of the action's model
values : [true|false|<ID of specific form view>]. -->
<rng:optional><rng:attribute name="creatable"/></rng:optional>
</rng:element>
</rng:zeroOrMore>
</rng:element>

View File

@ -0,0 +1,39 @@
.oe_module_icon, .oe_module_desc {
display: inline-block;
vertical-align: top;
}
.oe_module_icon {
width: 80px;
height: 80px;
padding: 4px;
}
.oe_module_desc {
width: 220px;
font-size: 13px;
padding: 2px 4px 8px;
color: #4c4c4c;
}
.oe_module_desc h4 {
margin: 0;
font-size: 13px;
}
.oe_module_desc h4 a {
color: #4c4c4c;
}
.oe_module_desc h4 a:hover {
text-decoration: underline;
}
.oe_module_desc p {
margin: 3px 0 5px;
}
.oe_kanban_record {
margin: 5px 0;
min-height: 100px;
}

View File

@ -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, core, icon) \
category_id, state, certificate, web, license, complexity, application, 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['core'], info['icon']))
info['complexity'], info['application'], 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)', (

View File

@ -250,8 +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.setdefault('application', False)
info.setdefault('icon', 'images/icon.png')
info['certificate'] = info.get('certificate') or None
info['web'] = info.get('web') or False
info['license'] = info.get('license') or 'AGPL-3'