# -*- coding: utf-8 -*-
from osv import fields, osv
-
-class Studies(osv.osv):
- _name = 'bikecoop.studies'
- _description = 'If partner is student, what is his school.'
+class Occupation(osv.osv):
+ _name = 'bikecoop.partner.occupation'
+ _description = 'If partner is a person, what is his job or studies'
_columns = {
- 'code': fields.char('Code', size=8, help='Code of the school'),
- 'name': fields.char('Name', size=128, help='Name of the school.', required=True),
+ 'code': fields.char('Code', size=8, help='Code of the occupation'),
+ 'name': fields.char('Name', size=128, help='Name of the job or studies', required=True),
'active': fields.boolean('Active', help='If check, this object is always available'),
}
'active': lambda *a: 1,
}
-Studies()
+Occupation()
class Partner(osv.osv):
_inherit = 'res.partner'
_columns = {
- 'studies_id': fields.many2one('bikecoop.studies', 'School', help='If partner is student, school where he is studing.'),
- }
-
- _defaults = {
- 'studies_id': lambda *a: 1,
+ 'associate_members': fields.one2many('res.partner', 'associate_member', 'Associate members', help='Members who are associated to this partner.'),
+ 'nationality_id': fields.many2one('res.country', 'Nationality', help='Partner\'s nationality if he is a person'),
+ 'occupation_id': fields.many2one('bikecoop.partner.occupation', 'Job or studies', help='Partner`s job or studies if he is a person'),
}
Partner()