From: Alicia FLOREZ Date: Fri, 31 May 2013 14:34:06 +0000 (+0200) Subject: Wizard pour l'ajout de phase à un palier, à finir X-Git-Url: http://git.inspyration.org/?p=OpenERP%2Fcmmi.git;a=commitdiff_plain;h=96a734d69f523be91b449709294b3e9f336a9def Wizard pour l'ajout de phase à un palier, à finir --- diff --git a/views/wizards/chantier.xml b/views/wizards/chantier.xml new file mode 100644 index 0000000..e69de29 diff --git a/wizards/chantier.py b/wizards/chantier.py new file mode 100644 index 0000000..006d389 --- /dev/null +++ b/wizards/chantier.py @@ -0,0 +1,7 @@ +#-*- coding: utf8 -*- + +from openerp.osv import osv, fields + +class ProjetChantierWizard(osv.TransientModel): + + _name = "cmmi.projet.chantier.wizard" \ No newline at end of file diff --git a/wizards/palierPhase.py b/wizards/palierPhase.py new file mode 100644 index 0000000..8716880 --- /dev/null +++ b/wizards/palierPhase.py @@ -0,0 +1,40 @@ +#-*- coding: utf8 -*- + +from openerp.osv import osv, fields + +# TODO: finir PalierPhaseWizard +class PalierPhaseWizard(osv.TransientModel): + + _name = "cmmi.palier.phase.wizard" + + + def default_get(self, cr, uid, fields, context=None): + result = osv.TransientModel.default_get(self, cr, uid, fields, context=context) + palier_id = context.get('palier_id', False) + if palier_id: + result['palier_id'] = palier_id + return result + + + + def _phases_selection(self, cr, uid, context=None): + phase_model = self.pool.get("cmmi.phase") + palier_phase_model = self.pool.get("cmmi.axes.palier.phase") + + if context is None or not context.has_key("palier_id"): + return [] + + + + _columns = { + "palier_id": fields.many2one("cmmi.axes.palier", + string="Palier", + required=True), +# "phase_id": fields.selection("cmmi.projet.phase", +# string="Phase", +# required=True, +# domain=[("selectionne", "=", True)]), + "phase_id": fields.function(_phases_selection, + string="Phase", + required=True), + } \ No newline at end of file