[module] +objet studies
[burette/bikecoop.git] / bikecoop.py
1 # -*- coding: utf-8 -*-
2 from osv import fields, osv
3
4
5 class Studies(osv.osv):
6 _name = 'bikecoop.studies'
7 _description = 'If partner is student, what is his school.'
8
9 _columns = {
10 'code': fields.char('Code', size=8, help='Code of the school'),
11 'name': fields.char('Name', size=128, help='Name of the school.', required=True),
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 Studies()
20
21
22 class Partner(osv.osv):
23 _inherit = 'res.partner'
24
25 _columns = {
26 'studies_id': fields.many2one('bikecoop.studies', 'School', help='If partner is student, school where he is studing.'),
27 }
28
29 _defaults = {
30 'studies_id': lambda *a: 1,
31 }
32
33 Partner()
34
35 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: