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