[ADD] default home action addon
bzr revid: xmo@openerp.com-20110719123305-bd5s1pbcjpoc927g
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name" : "OpenERP Web installer home",
|
||||
"version" : "2.0",
|
||||
"depends" : ['base'],
|
||||
'active': True,
|
||||
'js': ['static/src/js/home.js'],
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 948 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
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>
|
||||