add ics documents in profiles
[odoo/odoo.git] / addons / profile_association / profile_association.py
1 ##############################################################################
2 #
3 # Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
4 #
5 # $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
6 #
7 # WARNING: This program as such is intended to be used by professional
8 # programmers who take the whole responsability of assessing all potential
9 # consequences resulting from its eventual inadequacies and bugs
10 # End users who are looking for a ready-to-use solution with commercial
11 # garantees and support are strongly adviced to contract a Free Software
12 # Service Company
13 #
14 # This program is Free Software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License
16 # as published by the Free Software Foundation; either version 2
17 # of the License, or (at your option) any later version.
18 #
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write to the Free Software
26 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27 ###############################################################################
28
29 from osv import fields, osv
30 import pooler
31
32
33 class profile_association_config_install_modules_wizard(osv.osv_memory):
34     _name='profile.association.config.install_modules_wizard'
35     _columns = {
36         '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."),
37         'project':fields.boolean('Project Management'),
38         'board_document':fields.boolean('Document Management', help= "The Document Management System of Open ERP allows you to store, browse, automatically index, search and preview all kind of documents (internal documents, printed reports, calendar system). It opens an FTP access for the users to easily browse association's document."),
39         'segmentation':fields.boolean('Segmentation'),
40         'crm_configuration' : fields.boolean('Partner Relation & Calendars'),
41         '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."),
42     }
43     def action_cancel(self,cr,uid,ids,conect=None):
44         return {
45                 'view_type': 'form',
46                 "view_mode": 'form',
47                 'res_model': 'ir.actions.configuration.wizard',
48                 'type': 'ir.actions.act_window',
49                 'target':'new',
50          }
51     def action_install(self, cr, uid, ids, context=None):
52         result=self.read(cr,uid,ids)
53         mod_obj = self.pool.get('ir.module.module')
54         for res in result:
55             for r in res:
56                 if r<>'id' and res[r]:
57                     ids = mod_obj.search(cr, uid, [('name', '=', r)])
58                     mod_obj.action_install(cr, uid, ids, context=context)
59         cr.commit()
60         db, pool = pooler.restart_pool(cr.dbname, update_module=True)
61         return {
62                 'view_type': 'form',
63                 "view_mode": 'form',
64                 'res_model': 'ir.actions.configuration.wizard',
65                 'type': 'ir.actions.act_window',
66                 'target':'new',
67             }
68 profile_association_config_install_modules_wizard()