[ADD]: crm_helpdesk: Made new module for crm helpdesk from crm
[odoo/odoo.git] / addons / crm_helpdesk / crm_helpdesk.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution
5 #    Copyright (C) 2004-2010 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
22 from osv import fields
23 from osv import orm
24 from osv import osv
25 from crm import crm
26
27 class crm_helpdesk(osv.osv):
28     """ Helpdesk Cases """
29
30     _name = "crm.helpdesk"
31     _description = "Helpdesk Cases"
32     _order = "id desc"
33     _inherit = 'crm.case'
34
35     _columns = {
36             'date_closed': fields.datetime('Closed', readonly=True), 
37             'date': fields.datetime('Date'), 
38             'ref' : fields.reference('Reference', selection=crm._links_get, size=128), 
39             'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128), 
40             'canal_id': fields.many2one('res.partner.canal', 'Channel', \
41                             help="The channels represent the different communication \
42                              modes available with the customer." \
43                             " With each commercial opportunity, you can indicate\
44                              the canall which is this opportunity source."), 
45             'planned_revenue': fields.float('Planned Revenue'), 
46             'planned_cost': fields.float('Planned Costs'), 
47             'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), 
48             'probability': fields.float('Probability (%)'), 
49             'som': fields.many2one('res.partner.som', 'State of Mind', \
50                             help="The minds states allow to define a value scale which represents" \
51                                 "the partner mentality in relation to our services.The scale has" \
52                                 "to be created with a factor for each level from 0 \
53                                 (Very dissatisfied) to 10 (Extremely satisfied)."), 
54             'categ_id': fields.many2one('crm.case.categ', 'Category', \
55                             domain="[('section_id','=',section_id),\
56                             ('object_id.model', '=', 'crm.helpdesk')]"),
57             'duration': fields.float('Duration'),
58     }
59
60     _defaults = {
61         'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
62         'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
63     }
64
65 crm_helpdesk()
66
67 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
68