--- /dev/null
+#-*- coding: utf8 -*-
+'''
+Ce module contient tout ce qui est nécessaire pour qualifier une MO
+
+On distingue deux grands rôles qui sont les MOE et les MOA :
+
+MOE = Maîtrise d'oeuvre (ceuf qui font)
+MOA = Maîtrise d'ouvrage (ceux qui demandent et contrôlent)
+'''
+
+from openerp.osv import osv, fields
+
+
+class Role_MO(osv.Model):
+ """Role MO: différents types de MOE et MOA"""
+
+ _name = "projet.role_mo"
+
+ _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
+
+ _types_mo = [("MOE", "MOE"), ("MOA", "MOA")]
+
+ _columns = {
+ "name": fields.char(string="Title", size=64, required=True),
+ "code": fields.char(string="Code", size=8, required=True),
+ "description": fields.text(string="Description"),
+ "statut": fields.selection(_statuts, string="Statut"),
+ "type_mo": fields.selection(_types_mo, string="Type de MO", required=True),
+ "structures": fields.one2many("projet.structure",
+ "role_mo_id",
+ string="MOs"),
+ "mo_ids": fields.one2many("projet.mo",
+ "role_mo_id",
+ string="MOs"),
+ }
+
+
+class mo(osv.Model):
+ _name = "projet.mo"
+
+ _choses = [("primaire", "Primaire"),
+ ("secondaire", "Secondaire"),
+ ("generique", "Générique")]
+
+ _columns = {
+ "name": fields.char(string="Title"),
+ "description": fields.text(string="Description"),
+ "chose": fields.selection(_choses, string="Chose", required=True),
+ "role_mo_id": fields.many2one("projet.role_mo", string="Role"),
+ "charges": fields.one2many("projet.charge",
+ "mo_id",
+ string="Charges"),
+ }
+
+ _defaults = {
+ "chose": "generique"}
+
+
+class moe(osv.Model):
+ _name = "projet.moe"
+ _inherit = "projet.mo"
+
+ _columns = {
+ "projets": fields.one2many("projet.projet",
+ "moe_id",
+ string="Projets"),
+ }
+
+
+class moa(osv.Model):
+ _name= "projet.moa"
+ _inherit = "projet.mo"
+
+ _columns = {
+ "projets": fields.one2many("projet.projet",
+ "moa_id",
+ string="Projets"),
+ }
'''
from openerp.osv import osv, fields
-from gtk import TRUE
class Projet(osv.Model):
}
-class Role_MO(osv.Model):
- _name = "projet.role_mo"
-
- _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
-
- _types_mo = [("MOE", "MOE"), ("MOA", "MOA")]
-
- _columns = {
- "name": fields.char(string="Title", size=64, required=True),
- "code": fields.char(string="Code", size=8, required=True),
- "description": fields.text(string="Description"),
- "statut": fields.selection(_statuts, string="Statut"),
- "type_mo": fields.selection(_types_mo, string="Type de MO", required=True),
- "structures": fields.one2many("projet.structure",
- "role_mo_id",
- string="MOs"),
- "mo_ids": fields.one2many("projet.mo",
- "role_mo_id",
- string="MOs"),
- }
-
class Module(osv.Model):
_name = "projet.module"
string="Palier"),
}
-#TODO trouver un nom a cette chose
-class qqch(osv.Model):
- _name = "projet.qqch"
+class mesurable(osv.Model):
+ _name = "projet.mesurable"
_statuts = [("cree", "Crée"), ("encours", "En cours"),
("termine", "Terminé"), ("abandonne", "Abandonné"),
class Chantier(osv.Model):
_name = "projet.chantier"
- _inherit = "projet.qqch"
+ _inherit = "projet.mesurable"
_columns = {
"projet_id": fields.many2one("projet.projet",
_types_palier = [("normal", "Normal"), ("exceptionnel", "Exceptionnel"),
("correctif", "Correctif"), ("autre", "Autre")]
- _inherit = "projet.qqch"
+ _inherit = "projet.mesurable"
_columns = {
"type_palier": fields.selection(_types_palier, string="Type"),
"mo_id": fields.many2one("projet.mo",
string="Mo"),
}
-
-class mo(osv.Model):
- _name = "projet.mo"
-
- _choses = [("primaire", "Primaire"),
- ("secondaire", "Secondaire"),
- ("generique", "Générique")]
-
- _columns = {
- "name": fields.char(string="Title"),
- "description": fields.text(string="Description"),
- "chose": fields.selection(_choses, string="Chose", required=True),
- "role_mo_id": fields.many2one("projet.role_mo", string="Role"),
- "charges": fields.one2many("projet.charge",
- "mo_id",
- string="Charges"),
- }
-
- _defaults = {
- "chose": "generique"}
-
-
-class moe(osv.Model):
- _name = "projet.moe"
- _inherit = "projet.mo"
-
- _columns = {
- "projets": fields.one2many("projet.projet",
- "moe_id",
- string="Projets"),
- }
-
-
-class moa(osv.Model):
- _name= "projet.moa"
- _inherit = "projet.mo"
-
- _columns = {
- "projets": fields.one2many("projet.projet",
- "moa_id",
- string="Projets"),
- }