}
-class Phase(osv.Model):
+class PalierPhase(osv.Model):
_name = "cmmi.axes.palier.phase"
_description = "Step's phase / Phase d'un palier"
store=True,
string="Nom de la phase"),
"phase_id": fields.many2one("cmmi.projet.phase",
- string="Type phase"),
+ string="Phase du projet"),
"palier_id": fields.many2one("cmmi.axes.palier",
string="Palier"),
# backrefs
"projet_id": fields.many2one("cmmi.projet",
string="Projet",
required=True),
+ "module_ids": fields.many2many("cmmi.description.module",
+ "cmmi.axes.chantier.module",
+ "chantier_id",
+ "module_id",
+ "Modules"),
"evolutions": fields.one2many("cmmi.evolution",
"chantier_id",
string="Evolutions"),
class Domaine(osv.Model):
_name = "cmmi.description.domaine"
+ _description = "Table de reference des domaines"
+
_statuts = [("actif", "Actif"), ("inactif", "Inactif")]
_columns = {
"name": fields.char(string="Title", size=64, required=True),
"code": fields.char(string="Code", size=8),
"description": fields.text(string="Description"),
- "ordre": fields.integer(string="Ordre"),
"parent_id": fields.many2one("cmmi.description.domaine", string="Parent_id"),
"statut": fields.selection(_statuts, string="Statut"),
- "projets": fields.many2many("cmmi.projet", #TODO enlever ?
- string="Projets"),
}
_order = "id"
"phase_id": fields.many2one("cmmi.axes.palier.phase",
string="Phase"),
"evolution_id": fields.many2one("cmmi.evolution",
- string="Palier"),
+ string="Evolution"),
}
def create(self, cr, uid, vals, context=None):
_columns = {
"name": fields.char(string="Title", size=64, required=True),
"description": fields.text(string="Description"),
+ "evolution_id": fields.many2one("cmmi.evolution",
+ string="Palier"),
+ "phase_id": fields.many2one("cmmi.evolution.phase",
+ string="Phase de l'évolution",
+ required=True),
"teammember_id": fields.many2one("res.partner", # TODO: Vers l'association teammember MO plutôt que MO.
string="Team Member",
required=True),
- "phase_id": fields.many2one("cmmi.evolution.phase",
- string="Phase de l'évolution",
- required=True),
}
"type_mo": fields.selection(_types_mo,
string="Type de MO",
required=True),
- "structures": fields.one2many("cmmi.mo.structure",
- "role_mo_id",
- string="MOs"),
"mo_ids": fields.one2many("cmmi.mo",
"role_mo_id",
string="MOs"),
"moa_id",
string="Projets"),
}
-
-
-class Structure(osv.Model):
-
- _name = "cmmi.mo.structure"
-
- _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
-
- _columns = {
- "name": fields.char(string="Title", size=64, required=True),
- "code": fields.char(string="Code", size=8, required=True),
- "description": fields.text(string="Description"),
- "parent_id": fields.many2one("cmmi.mo.structure", string="Parent_id"),
- "statut": fields.selection(_statuts, string="Statut"),
- "role_mo_id": fields.many2one("cmmi.mo.role", string="Role MO"),
- "projets": fields.many2many("cmmi.projet",
- "projet_projet_structure_rel",
- "structures",
- string="Projets"),
- }
_columns = {
"name": fields.char(string="Title", size=64, required=True),
"description": fields.text(string="Description"),
+ # Backrefs
"domains": fields.one2many("cmmi.projet.domaine",
"project_id",
string="Domaines"),
+ "moe_ids": fields.one2many("cmmi.projet.moe",
+ "project_id",
+ string="MOEs"),
+ "moa_ids": fields.one2many("cmmi.projet.moa",
+ "project_id",
+ string="MOAs"),
"team_members": fields.one2many("cmmi.projet.teammember",
"projet_id",
string="Team Members"),
"evolutions": fields.one2many("cmmi.evolution",
"projet_id",
string="Evolutions"),
- "moe_ids": fields.one2many("cmmi.projet.moe",
- "project_id",
- string="MOEs"),
- "moa_ids": fields.one2many("cmmi.projet.moa",
- "project_id",
- string="MOAs"),
+ # TODO: faire un champs fonction qui renvoie uniquement les domaines sélectionnés
+
+ # Champs fonction rapatriant les mo ou domaine principaux
"moe_id": fields.function(_get_main_moe,
type="string",
string="MOE principale"),
"partner_id": fields.many2one("res.partner",
string="Team Member",
required=True),
- }
\ No newline at end of file
+ }
<field name="res_model">cmmi.description.domaine</field>
<field name="view_mode">tree,form</field>
</record>
-<!--
- <record model="ir.actions.act_window" id="structures_list_action">
- <field name="name">Liste des structures</field>
- <field name="res_model">cmmi.mo.structure</field>
- <field name="view_mode">tree,form</field>
- </record>
--->
+
<record model="ir.actions.act_window" id="phases_list_action">
<field name="name">Liste des phases</field>
<field name="res_model">cmmi.phase</field>
<!-- Menu secondaire Référentiels -->
<menuitem id="mt_referentiels_menu" name="Référentiels" parent="main_projet_menu" groups="base.group_no_one" /> <!-- group_no_one : Technical Features -->
- <menuitem id="mt_projet_domaines_list_menu" name="Liste des domaines" parent="mt_referentiels_menu" action="domaines_list_action"/><!--
- <menuitem id="mt_projet_structures_list_menu" name="Liste des structures" parent="mt_referentiels_menu" action="structures_list_action"/>-->
+ <menuitem id="mt_projet_domaines_list_menu" name="Liste des domaines" parent="mt_referentiels_menu" action="domaines_list_action"/>
<menuitem id="mt_projet_phases_list_menu" name="Liste des phases" parent="mt_referentiels_menu" action="phases_list_action"/><!--
<menuitem id="mt_projet_teammember_list_menu" name="Team members" parent="mt_referentiels_menu" action="teammembers_list_action"/>
-->
<field name="name" nolabel="1" />
<notebook colspan="4">
<page string="Projet">
+ <label for="description" />
<field name="description" nolabel="1" />
<label for="moe_id" />
<field name="moe_id" nolabel="1" widget="char" />
<label for="main_domain" />
<field name="main_domain" nolabel="1" widget="char" />
</page>
+ <page string="Modules">
+ <field name="modules">
+ <tree>
+ <field name="name" />
+ <field name="description" />
+ </tree>
+ </field>
+ </page>
<page string="MO">
<p>MOE</p>
<button type="action" target="new" name="%(wizard_add_moe_to_project)d" string="Add a MOE" class="oe_highlight" context="{'project_id': id}" />
</tree>
</field>
</page>
- <page string="Modules">
- <field name="modules">
- <tree>
- <field name="name" />
- <field name="description" />
- </tree>
- </field>
- </page>
<page string="Chantiers">
<field name="chantiers">
<tree>