1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2010 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 ##############################################################################
24 from osv import fields, osv, orm
30 'meeting' : 'Meetings',
32 'opportunity':'Opportunities',
34 'bugs':'Bug Tracking',
35 'fund':'Fund Raising',
36 'helpdesk':'HelpDesk',
38 'phonecall':'Phone Calls',
42 'summary':'Description',
43 'uid':'Calendar Code' ,
46 'url':'Partner Email' ,
47 'description':'Your action',
50 class document_ics_crm_wizard(osv.osv_memory):
51 _name='document.ics.crm.wizard'
52 _inherit = 'res.config'
55 'name':fields.char('Name', size=64),
56 'meeting': fields.boolean('Calendar of Meetings', help="Manages the calendar of meetings of the users."),
57 'lead': fields.boolean('Leads', help="Allows you to track and manage leads which are pre-sales requests or contacts, the very first contact with a customer request."),
58 'opportunity': fields.boolean('Business Opportunities', help="Tracks identified business opportunities for your sales pipeline."),
59 'jobs': fields.boolean('Jobs Hiring Process', help="Helps you to organise the jobs hiring process: evaluation, meetings, email integration..."),
60 'document_ics':fields.boolean('Shared Calendar', help=" Will allow you to synchronise your Open ERP calendars with your phone, outlook, Sunbird, ical, ..."),
61 'bugs': fields.boolean('Bug Tracking', help="Used by companies to track bugs and support requests on software"),
62 'helpdesk': fields.boolean('Helpdesk', help="Manages an Helpdesk service."),
63 'fund': fields.boolean('Fund Raising Operations', help="This may help associations in their fund raising process and tracking."),
64 'claims': fields.boolean('Claims', help="Manages the supplier and customers claims,including your corrective or preventive actions."),
65 'phonecall': fields.boolean('Phone Calls', help="Helps you to encode the result of a phone call or to plan a list of phone calls to process."),
68 'meeting': lambda *args: True,
69 'opportunity': lambda *args: True,
70 'phonecall': lambda *args: True,
73 def execute(self, cr, uid, ids, context=None):
75 @param self: The object pointer
76 @param cr: the current row, from the database cursor,
77 @param uid: the current user’s ID for security checks,
78 @param ids: List of Document CRM wizard’s IDs
79 @param context: A standard dictionary for contextual values """
81 data=self.read(cr, uid, ids, [])[0]
82 dir_obj = self.pool.get('document.directory')
83 dir_cont_obj = self.pool.get('document.directory.content')
84 dir_id = dir_obj.search(cr, uid, [('name', '=', 'Calendars')])
88 dir_id = dir_obj.create(cr, uid, {'name': 'Calendars' ,'user_id' : uid, 'type': 'directory'})
89 for section in ['meeting', 'lead', 'opportunity', 'jobs', 'bugs', 'fund', \
90 'helpdesk', 'claims', 'phonecall']:
92 section_id=self.pool.get('crm.case.section').search(cr, uid, \
93 [('name', '=', SECTION_NAME[section])])
95 object_id=self.pool.get('ir.model').search(cr, uid, [('name', '=', 'Case')])[0]
98 'name': SECTION_NAME[section],
100 'directory_id': dir_id,
103 'ics_object_id': object_id,
104 'ics_domain': [('section_id', '=', section_id[0])],
105 'include_name' : False
108 content_id = dir_cont_obj.create(cr, uid, vals_cont)
110 ics_obj=self.pool.get('document.directory.ics.fields')
111 for tag in ['description', 'url', 'summary', 'dtstart', 'dtend', 'uid']:
112 field_id = self.pool.get('ir.model.fields').search(cr, uid,\
113 [('model_id.name', '=', 'Case'),\
114 ('field_description', '=', ICS_TAGS[tag])])[0]
116 'field_id': field_id ,
118 'content_id': content_id ,
120 ics_obj.create(cr, uid, vals_ics)
122 document_ics_crm_wizard()
124 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: