From 748821f843d2e78383ffdc6d4316598c32898de9 Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Mon, 27 Aug 2012 13:09:10 +0200 Subject: [PATCH] [Module] -Studies +Occupation +Nationality --- bikecoop.py | 21 +++++++++------------ data/bikecoop.xml | 10 +++++----- demo/bikecoop.xml | 32 ++++++++++++++++++++++++-------- view/bikecoop_membership.xml | 4 +++- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/bikecoop.py b/bikecoop.py index 51c4417..bc8b677 100644 --- a/bikecoop.py +++ b/bikecoop.py @@ -1,14 +1,13 @@ # -*- 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'), } @@ -16,18 +15,16 @@ class Studies(osv.osv): '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() diff --git a/data/bikecoop.xml b/data/bikecoop.xml index 44b3b7b..ba29ea4 100644 --- a/data/bikecoop.xml +++ b/data/bikecoop.xml @@ -1,13 +1,13 @@ - - no - No studies at the moment + + none + No job or studies at the moment - + other - An other school that is not yet mentionned + An other type of occupation that is not mentionned diff --git a/demo/bikecoop.xml b/demo/bikecoop.xml index 5ce0f06..b331325 100644 --- a/demo/bikecoop.xml +++ b/demo/bikecoop.xml @@ -1,21 +1,37 @@ - + upmf - Université Pierre Mendès France + Studies: Université Pierre Mendès France - + us - Université Stendhal + Studies: Université Stendhal - + ujf - Université Joseph Fourrier + Studies: Université Joseph Fourrier - + inpg - INPG + Studies: INPG + + + OTH_STUD + Studies: Other studies, university that is not mentionned + + + FARM + Farmer + + + EMP + Employee + + + OTH_JOB + An other job that is not mentionned diff --git a/view/bikecoop_membership.xml b/view/bikecoop_membership.xml index f611c64..1344b19 100644 --- a/view/bikecoop_membership.xml +++ b/view/bikecoop_membership.xml @@ -29,6 +29,7 @@ + @@ -46,7 +47,8 @@ - + + -- 2.20.1