1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
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.
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.
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/>.
20 ##############################################################################
21 from osv import fields, osv
22 from itertools import chain
23 from operator import itemgetter
26 class base_setup_installer(osv.osv_memory):
27 _name = 'base.setup.installer'
28 _inherit = 'res.config.installer'
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')])
35 sorted(((m.name, m.shortdesc)
36 for m in modules.browse(cr, uid, ids)),
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)
48 ('sale','crm'): ['sale_crm'],
49 ('sale','project'): ['project_mrp'],
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"
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'),
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'),
88 base_setup_installer()