From 96a734d69f523be91b449709294b3e9f336a9def Mon Sep 17 00:00:00 2001 From: Alicia FLOREZ Date: Fri, 31 May 2013 16:34:06 +0200 Subject: [PATCH] =?utf8?q?Wizard=20pour=20l'ajout=20de=20phase=20=C3=A0=20un?= =?utf8?q?=20palier,=20=C3=A0=20finir?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- wizards/chantier.py | 7 +++++++ wizards/palierPhase.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 views/wizards/chantier.xml create mode 100644 wizards/chantier.py create mode 100644 wizards/palierPhase.py 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 -- 1.7.10.4