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 ##############################################################################
22 from osv import fields, osv, orm
25 class crm_fundraising(osv.osv):
26 """ Fund Raising Cases """
28 _name = "crm.fundraising"
29 _description = "Fund Raising Cases"
34 'date_closed': fields.datetime('Closed', readonly=True),
35 'date': fields.datetime('Date'),
36 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
37 'categ_id': fields.many2one('crm.case.categ', 'Category', \
38 domain="[('section_id','=',section_id),\
39 ('object_id.model', '=', 'crm.fundraising')]"),
40 'planned_revenue': fields.float('Planned Revenue'),
41 'planned_cost': fields.float('Planned Costs'),
42 'probability': fields.float('Probability (%)'),
43 'partner_name': fields.char("Employee's Name", size=64),
44 'partner_name2': fields.char('Employee Email', size=64),
45 'partner_phone': fields.char('Phone', size=32),
46 'partner_mobile': fields.char('Mobile', size=32),
47 'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
48 domain="[('section_id','=',section_id),\
49 ('object_id.model', '=', 'crm.fundraising')]"),
50 'type_id': fields.many2one('crm.case.resource.type', 'Fundraising Type', \
51 domain="[('section_id','=',section_id),\
52 ('object_id.model', '=', 'crm.fundraising')]"),
53 'duration': fields.float('Duration'),
54 'ref': fields.reference('Reference', selection=crm._links_get, size=128),
55 'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
56 'canal_id': fields.many2one('res.partner.canal', 'Channel', \
57 help="The channels represent the different communication \
58 modes available with the customer." \
59 " With each commercial opportunity, you can indicate\
60 the canall which is this opportunity source."),
61 'som': fields.many2one('res.partner.som', 'State of Mind', \
62 help="The minds states allow to define a value scale which represents" \
63 "the partner mentality in relation to our services.The scale has" \
64 "to be created with a factor for each level from 0 \
65 (Very dissatisfied) to 10 (Extremely satisfied)."),
69 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
70 'probability':lambda *a:0.0,
71 'planned_cost':lambda *a:0.0,
72 'planned_revenue':lambda *a:0.0,