Configuration wizard to install extra modules on accounting,association,manufacturing...
[odoo/odoo.git] / addons / profile_service / profile_service.py
1 # -*- encoding: utf-8 -*-
2 ##############################################################################
3 #
4 # Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
5 #
6 # $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
7 #
8 # WARNING: This program as such is intended to be used by professional
9 # programmers who take the whole responsability of assessing all potential
10 # consequences resulting from its eventual inadequacies and bugs
11 # End users who are looking for a ready-to-use solution with commercial
12 # garantees and support are strongly adviced to contract a Free Software
13 # Service Company
14 #
15 # This program is Free Software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License
17 # as published by the Free Software Foundation; either version 2
18 # of the License, or (at your option) any later version.
19 #
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28 ###############################################################################
29
30 from osv import fields, osv
31 import pooler
32
33 class config_install_extra_modules(osv.osv_memory):
34     _name='config.install_extra_modules'
35     _rec_name = 'crm_configuration'
36     _columns = {
37         'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
38         'hr_timesheet':fields.boolean('Timesheets', help="Timesheets allows you to track time and costs spent on different projects, represented by analytic accounts."),
39         'hr_timesheet_invoice':fields.boolean('Invoice on Timesheets', help="There are different invoicing methods in OpenERP: from sale orders, from shippings, ... Install this module if you plan to invoice your customers based on time spent on projects."),
40         'hr_holidays':fields.boolean('Holidays Management', help="Tracks the full holidays management process, from the employee's request to the global planning."),
41         'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
42         'account_budget_crossover':fields.boolean('Analytic Budgets', help="Allows you to manage analytic budgets by journals. This module is used to manage budgets of your projects."),
43         'project_gtd':fields.boolean('Getting Things Done', help="GTD is a methodology to efficiently organise yourself and your tasks. This module fully integrates GTD principle with OpenERP's project management."),
44         'scrum':fields.boolean('Scrum Methodology', help="Scrum is an 'agile development methodology', mainly used in IT projects. It helps you to manage teams, long term roadmaps, sprints, and so on."),
45         'base_contact':fields.boolean('Contacts Management', help="Allows you to manage partners (enterprises), addresses of partners and contacts of these partners (employee/people). Install this if you plan to manage your relationships with partners and contacts."),
46     }
47     def action_cancel(self,cr,uid,ids,conect=None):
48         return {
49                 'view_type': 'form',
50                 "view_mode": 'form',
51                 'res_model': 'ir.module.module.configuration.wizard',
52                 'type': 'ir.actions.act_window',
53                 'target':'new',
54          }
55     def action_install(self, cr, uid, ids, context=None):
56         result=self.read(cr,uid,ids)        
57         mod_obj = self.pool.get('ir.module.module')
58         for res in result:
59             for r in res:
60                 if r<>'id' and res[r]:                
61                     ids = mod_obj.search(cr, uid, [('name', '=', r)])   
62                     mod_obj.action_install(cr,uid,ids,context=context)                       
63         cr.commit()
64         db, pool = pooler.restart_pool(cr.dbname, update_module=True)
65         return {
66                 'view_type': 'form',
67                 "view_mode": 'form',
68                 'res_model': 'ir.module.module.configuration.wizard',
69                 'type': 'ir.actions.act_window',
70                 'target':'new',
71             }
72 config_install_extra_modules()
73
74 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
75