47d7117f44ee1a0ebdd07576aafbbbdac7fd14cc
[burette/bikecoop.git] / bikecoop.py
1 # -*- coding: utf-8 -*-
2 from osv import fields, osv
3
4 class Theme(osv.osv):
5 _name = 'bikecoop.partner.theme'
6 _description = 'Themes that could be related to a partner'
7
8 _columns = {
9 'code': fields.char('Code', size=8, help='Code of the occupation'),
10 'name': fields.char('Name', size=128, help='Name of the job or studies', required=True, translate=True),
11 'domain': fields.selection([('gender', 'Gender'), ('occupation', 'Occupation'), ('volunteer', 'Volunteer')], 'Domain', required=True, size=24),
12 'active': fields.boolean('Active', help='If check, this object is always available'),
13 }
14
15 _defaults = {
16 'active': lambda *a: 1,
17 }
18
19 Theme()
20
21
22 class Partner(osv.osv):
23 _inherit = 'res.partner'
24
25 _columns = {
26 'associate_members': fields.one2many('res.partner', 'associate_member', 'Associate members', help='Members who are associated to this partner.'),
27 'nationality_id': fields.many2one('res.country', 'Nationality', help='Partner\'s nationality if he is a person'),
28 'occupation_id': fields.many2one('bikecoop.partner.theme', 'Occupation', help='Main occupation of this partner'),
29 'volunteer_ids': fields.many2many('bikecoop.partner.theme', 'res_partner_bikecoop_theme_rel', 'partner_id', 'theme_id', 'Want to be volunteer?', help='What kind of volunteer activities you want to do with us?'),
30 'gender_id': fields.many2one('bikecoop.partner.theme', 'Gender'),
31 'member_ident': fields.char('Member identifier', size=64, readonly=True),
32 }
33
34 Partner()
35
36 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: