13392dfe3a3f135afb97af70e6bb29b2b71866ee
[OpenERP/cmmi.git] / phase.py
1 #-*- coding: utf8 -*-
2 '''
3 '''
4
5 from openerp.osv import osv, fields
6
7
8 class TypePhase(osv.Model):
9     _name = "cmmi.phase.type"
10
11     _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
12
13     _columns = {
14         "name": fields.char(string="Title", size=64, required=True),
15         "description": fields.text(string="Description"),
16         "statut": fields.selection(_statuts, string="Statut"),
17     }
18
19
20 class Phase(osv.Model):
21     _name = "cmmi.phase"
22
23     _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
24
25     _columns = {
26         "name": fields.char(string="Title", size=64, required=True),
27         "description": fields.text(string="Description"),
28         "statut": fields.selection(_statuts, string="Statut"),
29         "type_phase_id": fields.many2one("cmmi.phase.type",
30                                          string="Type phase"),
31         "charges": fields.one2many("cmmi.evolution.charge",
32                                    "phase_id",
33                                    string="Charges"),
34         "evolutions": fields.one2many("cmmi.evolution",
35                                       "phase_id",
36                                       string="Evolutions"),
37         "palier_id": fields.many2one("cmmi.axes.palier",
38                                      string="Palier"),
39     }