_name = "cmmi.projet"
- _domains = {
- 'moe': [('role_mo_id.type_mo', '=', "MOE")],
- 'moa': [('role_mo_id.type_mo', '=', "MOA")],
- }
-
_columns = {
"name": fields.char(string="Title", size=64, required=True),
"description": fields.text(string="Description"),
"domaines": fields.one2many("cmmi.projet.domaine",
"project_id",
string="Domaines"),
- "structures": fields.many2many("cmmi.mo.structure",
- string="Structures"),
- "structures_moe": fields.many2many("cmmi.mo.structure",
- string="Structures",
- domain=_domains['moe']),
- "structures_moa": fields.many2many("cmmi.mo.structure",
- string="Structures",
- domain=_domains['moa']),
"team_members": fields.many2many("cmmi.partner.teammember",
"cmmi_projet_teammember_rel",
"projet_id",
"evolutions": fields.one2many("cmmi.evolution",
"projet_id",
string="Evolutions"),
- "moe_id": fields.many2one("cmmi.mo.moe", string="MoE", required=True),
- "moa_id": fields.many2one("cmmi.mo.moa", string="MoA", required=True),
- "main_domain": fields.many2one("cmmi.description.domaine",
- string="Domaine principal"),
- "main_structure": fields.many2one("cmmi.mo.structure",
- string="Structure principale"),
+ "moe_ids": fields.one2many("cmmi.projet.moe",
+ "project_id",
+ string="MOEs"),
+ "moa_ids": fields.one2many("cmmi.projet.moa",
+ "project_id",
+ string="MOAs"),
+ "moe_id": fields.one2many("cmmi.projet.moe",
+ "project_id",
+ string="MOE principale",
+ domaine=[('main', '=', True)]),
+ "moa_id": fields.one2many("cmmi.projet.moa",
+ "project_id",
+ string="MOA principale",
+ domaine=[('main', '=', True)]),
+ "main_domain": fields.one2many("cmmi.projet.domaine",
+ "project_id",
+ string="Domaine principal",
+ domaine=[('main', '=', True)]),
}
def action_add_domain(self, cr, uid, ids, context=None):
string="MOE"),
}
+ def onchange_main(self, cr, uid, ids, project, moe, main, context=None):
+ pass
+
class ProjetMoa(osv.Model):
- _name = "cmmi.projet.moe"
+ _name = "cmmi.projet.moa"
def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
if isinstance(ids, (int, long)):
string="MOA"),
}
+ def onchange_main(self, cr, uid, ids, project, moa, main, context=None):
+ pass
+
class ProjetPhase(osv.Model):
_name = "cmmi.projet.phase"
<field name="name" nolabel="1" />
<notebook colspan="4">
<page string="Projet">
- <field name="description" nolabel="1" />
+ <field name="description" nolabel="1" /><!--
<label for="moe_id" colspan="1" />
<field name="moe_id" nolabel="1" />
<label for="moa_id" colspan="1" />
<field name="moa_id" nolabel="1" />
<label for="main_domain" colspan="1" />
- <field name="main_domain" nolabel="1" widget="selection" />
+ <field name="main_domain" nolabel="1" widget="selection" />-->
</page>
<page string="MO">
<p>MOE</p>
<button type="action" target="new" name="cmmi.wizard_add_moe_to_project" string="Add a MOE" class="oe_highlight" context="{'project_id': id}" />
- <field name="structures_moe">
- <tree>
+ <field name="moe_ids">
+ <tree create="false" delete="true" editable="true">
+ <field name="project_id" invisible="1" />
+ <field name="moe_id" invisible="1" />
<field name="name" />
- <field name="description" />
- <field name="role_mo_id" />
+ <field name="main" on_change="onchange_main(project_id, moe_id, main)" />
</tree>
</field>
<p>MOA</p>
<button type="action" target="new" name="cmmi.wizard_add_moa_to_project" string="Add a MOA" class="oe_highlight" context="{'project_id': id}" />
- <field name="structures_moe">
- <tree>
+ <field name="moa_ids">
+ <tree create="false" delete="true" editable="true">
+ <field name="project_id" invisible="1" />
+ <field name="moa_id" invisible="1" />
<field name="name" />
- <field name="description" />
- <field name="role_mo_id" />
- <field name="statut" />
+ <field name="main" on_change="onchange_main(project_id, moa_id, main)" />
</tree>
</field>
</page>