[rem] redundant terp metadata
[odoo/odoo.git] / addons / base_setup / installer.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution
5 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
6 #
7 #    This program is free software: you can redistribute it and/or modify
8 #    it under the terms of the GNU Affero General Public License as
9 #    published by the Free Software Foundation, either version 3 of the
10 #    License, or (at your option) any later version.
11 #
12 #    This program is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU Affero General Public License for more details.
16 #
17 #    You should have received a copy of the GNU Affero General Public License
18 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 #
20 ##############################################################################
21 from osv import fields, osv
22 from itertools import chain
23 from operator import itemgetter
24 import netsvc
25
26 class base_setup_installer(osv.osv_memory):
27     _name = 'base.setup.installer'
28     _inherit = 'res.config.installer'
29
30     def _get_charts(self, cr, uid, context=None):
31         modules = self.pool.get('ir.module.module')
32         ids = modules.search(cr, uid, [('category_id','=','Account Charts'),
33                                        ('state','!=','installed')])
34         return list(
35             sorted(((m.name, m.shortdesc)
36                     for m in modules.browse(cr, uid, ids)),
37                    key=itemgetter(1)))
38
39     def _if_account(self, cr, uid, ids, context=None):
40         chart = self.read(cr, uid, ids, ['charts'],
41                           context=context)[0]['charts']
42         self.logger.notifyChannel(
43             'installer', netsvc.LOG_DEBUG,
44             'Addon "account" selected, installing chart of accounts %s'%chart)
45         return [chart]
46
47     _install_if = {
48         ('sale','crm'): ['sale_crm'],
49         ('sale','project'): ['project_mrp'],
50         }
51     _columns = {
52         # Generic modules
53         'crm':fields.boolean('Customer Relationship Management',
54             help="Helps you track and manage relations with customers such as"
55                  " leads, requests or issues. Can automatically send "
56                  "reminders, escalate requests or trigger business-specific "
57                  "actions based on standard events."),
58         'sale':fields.boolean('Sales Management',
59             help="Helps you handle your quotations, sale orders and invoicing"
60                  "."),
61         'project':fields.boolean('Project Management',
62             help="Helps you manage your projects and tasks by tracking them, "
63                  "generating planings, etc..."),
64         'knowledge':fields.boolean('Knowledge Management',
65             help="Lets you install addons geared towards sharing knowledge "
66                  "with and between your employees."),
67         'stock':fields.boolean('Warehouse Management',
68             help="Helps you manage your stocks and stocks locations, as well "
69                  "as the flow of stock between warehouses."),
70         'mrp':fields.boolean('Manufacturing'),
71         'account':fields.boolean('Financial & Accounting'),
72         'charts':fields.selection(_get_charts, 'Chart of Accounts'),
73         'purchase':fields.boolean('Purchase Management'),
74         'hr':fields.boolean('Human Resources'),
75         'point_of_sale':fields.boolean('Point of Sales'),
76         'marketing':fields.boolean('Marketing'),
77         'misc_tools':fields.boolean('Miscellaneous Tools'),
78         'report_designer':fields.boolean('Advanced Reporting'),
79         # Vertical modules
80         'profile_association':fields.boolean('Associations'),
81         'profile_training':fields.boolean('Training Centers'),
82         'profile_auction':fields.boolean('Auction Houses'),
83         'profile_bookstore':fields.boolean('Book Stores'),
84         }
85     _defaults = {
86         'crm': True,
87         }
88 base_setup_installer()
89