Réorganisation DB
[OpenERP/cmmi.git] / projet.py
1 #-*- coding: utf8 -*-
2 '''
3 '''
4
5 from openerp.osv import osv, fields
6
7 class Projet(osv.Model):
8
9     _name = "cmmi.projet"
10
11     _columns = {
12         "name": fields.char(string="Title", size=64, required=True),
13         "description": fields.text(string="Description"),
14         "domaines": fields.many2many("projet.domaine",
15                                      "projet_projet_domaine_rel",
16                                      "projets",
17                                      string="Domaines"),
18         "structures": fields.many2many("projet.structure",
19                                        "projet_projet_structure_rel",
20                                        "projets",
21                                        string="Structures"),
22         "structures_moe": fields.many2many("projet.structure",
23                                            "projet_projet_structure_rel",
24                                            "projets",
25                                            string="Structures",
26                                            domain=[('role_mo_id.type_mo', '=', "MOE")]),
27         "structures_moa": fields.many2many("projet.structure",
28                                            "projet_projet_structure_rel",
29                                            "projets",
30                                            string="Structures",
31                                            domain=[('role_mo_id.type_mo', '=', "MOA")]),
32         "team_members": fields.many2many("projet.teammember",
33                                          "projet_projet_teammember_rel",
34                                          "projets",
35                                          string="Team Members"),
36         "modules": fields.one2many("projet.module",
37                                    "projet_id",
38                                    string="Modules"),
39         "chantiers": fields.one2many("projet.chantier",
40                                      "projet_id",
41                                      string="Chantiers"),
42         "paliers": fields.one2many("projet.palier",
43                                    "projet_id",
44                                    string="Paliers"),
45         "phases": fields.one2many("projet.phase",
46                                    "projet_id",
47                                    string="Phases"),
48         "evolutions":fields.one2many("projet.evolution",
49                                      "projet_id",
50                                      string="Evolutions"),
51         "moe_id": fields.many2one("projet.moe", string="MoE", required=True),
52         "moa_id": fields.many2one("projet.moa", string="MoA", required=True),
53         "main_domain": fields.many2one("projet.domaine",
54                                        string="Domaine principal"),
55         "main_structure": fields.many2one("projet.structure",
56                                           string="Structure principale"),
57     }