cahnges in profiling
[odoo/odoo.git] / addons / crm_configuration / crm_config.py
index 4a7167f..db7a2a2 100644 (file)
@@ -1,8 +1,37 @@
 # -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
 import time
 import tools
 from osv import fields,osv,orm
-
+import os
 import mx.DateTime
 import base64
 
@@ -49,6 +78,53 @@ class crm_cases(osv.osv):
 
 crm_cases()
 
+class crm_menu_config_wizard(osv.osv_memory):
+    _name='crm.menu.config_wizard'
+    _columns = {
+        'name':fields.char('Name', size=64),
+        'meeting' : fields.boolean('Calendar of Meetings', help="Manages the calendar of meetings of the users."),
+        'lead' : fields.boolean('Leads', help="Allows you to track and manage leads which are pre-sales requests, the very first contact with a customer request."),
+        'opportunity' : fields.boolean('Business Opportunities', help="Tracks identified business opportunities for your sales pipeline."),
+        'jobs' : fields.boolean('Jobs Hiring Process', help="Help you to organise the jobs hiring process: evaluation, meetings, email integration..."),
+        '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."),
+        'bugs' : fields.boolean('Bug Tracking', help="Used by companies to track bugs and support requests on softwares"),
+        'fund' : fields.boolean('Fund Raising Operations', help="This may help associations in their fund raising process and tracking."),
+        'helpdesk' : fields.boolean('Help Desk Operations', help="This may help your Help Desk."),
+    }
+    _defaults = {
+        'meeting': lambda *args: True,
+        'jobs': lambda *args: True,
+        'opportunity': lambda *args: True,
+    }
+    def action_create(self, cr, uid, ids, *args):
+        for res in self.read(cr,uid,ids):
+            res.__delitem__('id')
+    #        'update'
+            for section in res :
+                if res[section]:
+                    file_name = 'crm_'+section+'_menu.xml'
+                    try:
+                        tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_configuration',file_name )),  {}, 'init', *args)
+                    except Exception, e:
+                        raise osv.except_osv('Error !', e)
+
+        return {
+                'view_type': 'form',
+                "view_mode": 'form',
+                'res_model': 'ir.actions.configuration.wizard',
+                'type': 'ir.actions.act_window',
+                'target':'new',
+         }
+    def action_cancel(self,cr,uid,ids,conect=None):
+        return {
+                'view_type': 'form',
+                "view_mode": 'form',
+                'res_model': 'ir.actions.configuration.wizard',
+                'type': 'ir.actions.act_window',
+                'target':'new',
+         }
+
+crm_menu_config_wizard()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: