[MERGE] module kanban

bzr revid: al@openerp.com-20111208224332-4wg6k0w1uzuwlyum
This commit is contained in:
Antony Lesuisse 2011-12-08 23:43:32 +01:00
commit 926041c8b8
4 changed files with 70 additions and 27 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

@ -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>
@ -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

@ -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

@ -251,7 +251,7 @@ def load_information_from_description_file(module):
info.setdefault('description', '')
info.setdefault('complexity', 'normal')
info.setdefault('application', False)
info.setdefault('icon', '')
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'