break
else:
result[project.id] = "Any MOE is selected as main MOE yet"
+ return result
+
+ def _get_phases_selectionnees(self, cr, uid, ids, field_name=None, arg=None, context=None):
+ result = {}
+ for projet in self.browse(cr, uid, ids, context=context):
+ res = []
+ for phase in projet.phases:
+ #import pdb; pdb.set_trace()
+ if phase.selectionne:
+ res.append(phase.id)
+ result[projet.id] = res
return result
"main_domain": fields.function(_get_main_domain,
type="string",
string="Domaine principal"),
+ "phases_selectionnees": fields.function(_get_phases_selectionnees,
+ type="one2many",
+ obj="cmmi.projet.phase",
+ string="Phases sélectionnées"),
}
</tree>
</field>
</page>
+ <page string="Phases sélectionnées">
+ <field name="phases_selectionnees" />
+ </page>
<page string="Evolutions">
<field name="evolutions">
<tree>
# Fermer simplement la fenêtre
return {'type': 'ir.actions.act_window_close'}
- #-----------------------------------------------------------------------
+ #======================================================================
# # Renvoi vers la vue du modèle
# return {
# "type": 'ir.actions.act_window',
# #'target': 'new', = pop-up
# 'context': context,
# }
- #-----------------------------------------------------------------------
+ #======================================================================
_columns = {
"main": fields.boolean(string="Domaine principal ?"),