[Module]
[burette/bikecoop.git] / bikecoop.py
1 # -*- coding: utf-8 -*-
2 from osv import fields, osv
3
4 class Occupation(osv.osv):
5 _name = 'bikecoop.partner.occupation'
6 _description = 'If partner is a person, what is his job or studies'
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),
11 'active': fields.boolean('Active', help='If check, this object is always available'),
12 }
13
14 _defaults = {
15 'active': lambda *a: 1,
16 }
17
18 Occupation()
19
20
21 class Partner(osv.osv):
22 _inherit = 'res.partner'
23
24 _columns = {
25 'associate_members': fields.one2many('res.partner', 'associate_member', 'Associate members', help='Members who are associated to this partner.'),
26 'nationality_id': fields.many2one('res.country', 'Nationality', help='Partner\'s nationality if he is a person'),
27 'occupation_id': fields.many2one('bikecoop.partner.occupation', 'Job or studies', help='Partner`s job or studies if he is a person'),
28 }
29
30 Partner()
31
32 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: