[ADD] default home action addon

bzr revid: xmo@openerp.com-20110719123305-bd5s1pbcjpoc927g
This commit is contained in:
Xavier Morel
2011-07-19 14:33:05 +02:00
parent 6705b9c249
commit c27a79fbdd
17 changed files with 64 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"name" : "OpenERP Web installer home",
"version" : "2.0",
"depends" : ['base'],
'active': True,
'js': ['static/src/js/home.js'],
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,40 @@
openerp.base_default_home = function (openerp) {
QWeb.add_template('/base_default_home/static/src/xml/base_default_home.xml');
var old_home = openerp.base.WebClient.prototype.default_home;
openerp.base_default_home = {
applications: [[
'sales',
'purchases',
'warehouse',
'manufacturing'
], [
'project',
'accounting',
'human resources',
'marketing'
], [
'knowledge',
'point of sale',
'tools',
'administration'
]
]
};
openerp.base.WebClient.prototype.default_home = function () {
var self = this;
var Installer = new openerp.base.DataSet(
this.session, 'base.setup.installer');
Installer.call('already_installed', [], function (installed_modules) {
if (!_(installed_modules).isEmpty()) {
return old_home.call(self);
}
self.$element.find('.oe-application').html(
QWeb.render('HomeInstallerTiles', {
rows: openerp.base_default_home.applications
}));
});
}
};
@@ -0,0 +1,17 @@
<template>
<div t-name="HomeInstallerTiles" class="oe-dashboard-home-tiles">
<table width="100%">
<tr t-foreach="rows" t-as="row">
<td t-foreach="row" t-as="application" width="25%">
<div class="oe-dashboard-home-tile"
t-att-data-menuid="application">
<div class="oe-dashboard-home-tile-icon">
<img t-att-src="'/base_default_home/static/src/img/' + application.replace(new RegExp('\\s', 'g'), '-') + '.png'"/>
</div>
<span><t t-esc="application"/></span>
</div>
</td>
</tr>
</table>
</div>
</template>