[IMP] department_id added in expense,timesheet,applicant,holidays. Department view...
[odoo/odoo.git] / addons / crm_hr / crm_hr.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
22 from osv import fields,osv,orm
23 from crm import crm
24
25 class crm_job(osv.osv):
26     _name = "crm.job"
27     _description = "Job Cases"
28     _order = "id desc"
29     _inherit ='crm.case'
30     _columns = {
31             'date_closed': fields.datetime('Closed', readonly=True),
32             'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
33             'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
34             'planned_revenue': fields.float('Planned Revenue'),
35             'planned_cost': fields.float('Planned Costs'),
36             'probability': fields.float('Probability (%)'),
37             'partner_name': fields.char("Employee's Name", size=64),
38             'partner_name2': fields.char('Employee Email', size=64),
39             'partner_phone': fields.char('Phone', size=32),
40             'partner_mobile': fields.char('Mobile', size=32),
41             'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
42             'type_id': fields.many2one('crm.case.resource.type', 'Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
43             'duration': fields.float('Duration'),
44             'case_id': fields.many2one('crm.case', 'Related Case'),
45             'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
46             'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
47             'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
48                                                                         " With each commercial opportunity, you can indicate the canall which is this opportunity source."),
49             'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
50                                                                        "the partner mentality in relation to our services.The scale has" \
51                                                                        "to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
52             'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
53             'department_id':fields.many2one('hr.department','Department'),
54     }
55
56 crm_job()